Created
December 30, 2010 19:53
-
-
Save juanplopes/760197 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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