Ejemplo n.º 1
0
        public static IRepository <T> GetService <T>() where T : class
        {
            string dbConn = "";

            try
            {
                dbConn = ConfigurationManager.ConnectionStrings["ProizvodiEntities"].ConnectionString;
            }
            catch
            {
                dbConn = String.Empty;
            }

            if (!string.IsNullOrEmpty(dbConn))
            {
                ProizvodiEntities pModel = new ProizvodiEntities();
                return((IRepository <T>) new ProizvodRepository(pModel));
            }
            else
            {
                return((IRepository <T>) new JsonFileRepository(@"C:\borisa_cajic\proizvodi\jsonTest.json"));
            }
        }
Ejemplo n.º 2
0
 public ProizvodRepository(ProizvodiEntities context) : base(context)
 {
 }