Skip to content

Instantly share code, notes, and snippets.

@juanplopes
Created December 30, 2010 19:53
Show Gist options
  • Save juanplopes/760197 to your computer and use it in GitHub Desktop.
Save juanplopes/760197 to your computer and use it in GitHub Desktop.
public class Usuario
{
public class Map : ClassMap<Usuario>
{
public Map()
{
Table("tsdrusu0");
Id(x => x.Id).Column("id_usu");
Map(x => x.NmLogin).Column("nm_login");
}
}
public virtual int Id { get; set; }
public virtual string NmLogin { get; set; }
}
class Program
{
static void Main(string[] args)
{
Simply.Do.Configure.NHibernateQuickly(
@".\sqlexpress", "sdrh", typeof(Program).Assembly);
using (var context = Simply.Do.EnterContext())
{
var list = context.Session.Query<Usuario>().ToList();
Console.WriteLine(list.Count);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment