public static Repository <T> BaseRepository(string ConnStr = "")
        {
            //string ConnStr = ConfigurationManager.ConnectionStrings["DbConnStr"].ConnectionString;

            IConnectionFactory connectionFactory = new ConnectionMssql
            {
                ConnectionString = ConnStr
            };

            Repository <T> repository = new Repository <T>(connectionFactory);

            return(repository);
        }
示例#2
0
        public static void FindById(int id)
        {
            IConnectionFactory connectionFactory = new ConnectionMssql
            {
                ConnectionString = connStr
            };

            Repository <Urun> repository = new Repository <Urun>(connectionFactory);

            ReturnOutput returnOutput = new ReturnOutput();
            var          result       = repository.FindById(2, ref returnOutput);

            int cnt = 1;
        }
示例#3
0
        public static void Add()
        {
            Urun urun = new Urun {
                Description = "Muz",
                Price       = 10M,
                CreateDate  = DateTime.Now
            };

            IConnectionFactory connectionFactory = new ConnectionMssql
            {
                ConnectionString = connStr
            };

            Repository <Urun> repository = new Repository <Urun>(connectionFactory);

            ReturnOutput returnOutput = new ReturnOutput();

            repository.Add(urun, ref returnOutput);
        }
示例#4
0
        public static void AddNew()
        {
            ProductCategorys entity = new ProductCategorys
            {
                CategoryName = "aa",
                CreatedBy    = 1,
                LevelOrderNo = 1,
                CreatedDate  = DateTime.Now
            };

            IConnectionFactory connectionFactory = new ConnectionMssql
            {
                ConnectionString = connStr
            };

            Repository <ProductCategorys> repository = new Repository <ProductCategorys>(connectionFactory);

            ReturnOutput returnOutput = new ReturnOutput();

            repository.Add(entity, ref returnOutput);
        }