Is it possible to return it as an object if I do
Select OneItem from Table Where OtherItem = "blah"?
Is there a better way to do this?
I am creating a constructor to return an object based on its name, not its identifier.
query.UniqueResult<T>() returns only one T
query.UniqueResult<T>()
If there is more than one potential result, then query.FirstResult() might be better.
query.FirstResult()
Or using LINQ, you can have query.First() , query.SingleOrDefault() , query.Min(predicate) , etc.
query.First()
query.SingleOrDefault()
query.Min(predicate)
Source: https://habr.com/ru/post/1276613/More articles:Lightbox style dialogs in MFC - c ++Wild Wild Poker Hand Count - algorithmDynamic regex for date formats - regexDetermine page size via HttpModule - asp.netSimple and basic form of spam: checking for Javascript? - javascriptUsing Windows XP as SQL Server - sql-serverHow to change work item type to include additional information in TFS? - tfsHow to get javadoc to reference Java API using Ant task? - javadocHow to enable open id in Java Webapp? - javaJava ConnectionPool does not close, gets stuck in a dream - javaAll Articles