Beispiel #1
0
        static void Main(string[] args)
        {
            DatabaseFactory DBF = new DatabaseFactory();
            UnitOfWork      UF  = new UnitOfWork(DBF);
            JeeModel        ctx = new JeeModel();
            artwork         a   = new artwork();

            ServicePattern.Service <artwork> SP = new Service <artwork>(UF);
            a = SP.FindById(1);
            System.Console.Out.WriteLine(a.title);
            a.title = "il3asba rabek";
            System.Console.Out.WriteLine(a.title);
            SP.Update(a);
            SP.remove(a);
            System.Console.Out.WriteLine(a.title + " after");

            System.Console.ReadKey();
        }
 public UnitOfWork(DatabaseFactory dbFactory)
 {
     this.dbfactory = dbFactory;
     ctx            = dbfactory.Mycontext;
 }
 public RepositoryBase(DatabaseFactory dbfactory)
 {
     ctx   = dbfactory.Mycontext;
     dbset = ctx.Set <T>();
 }
 public DatabaseFactory()
 {
     mycontext = new JeeModel();
 }