예제 #1
0
        public static List <TPage> GetAllDataWithMap(string whereQuery)
        {
            string baseWhereQuery = " Where IsDeleted=0";

            if (!string.IsNullOrEmpty(whereQuery))
            {
                baseWhereQuery = baseWhereQuery + " AND " + whereQuery;
            }

            ReturnOutput returnOutput = new ReturnOutput();

            var repository = BaseCommonRepository <T> .BaseRepository();

            var data = repository.Find(baseWhereQuery, ref returnOutput);

            var retVal = MappingExtensions.ToModel <T, TPage>(data.ToList());

            return(retVal);
        }
예제 #2
0
        public static List <T> GetAllData(string whereQuery)
        {
            string baseWhereQuery = " Where IsDeleted=0";

            if (!string.IsNullOrEmpty(whereQuery))
            {
                baseWhereQuery = whereQuery;
            }

            //baseWhereQuery = baseWhereQuery + " AND " + whereQuery;

            ReturnOutput returnOutput = new ReturnOutput();

            var repository = BaseCommonRepository <T> .BaseRepository();

            var data = repository.Find(baseWhereQuery, ref returnOutput);

            return(data.ToList());
        }
예제 #3
0
        public static ReturnOutput SetDeletedWithUpdate(int id, bool isDeleted)
        {
            var repository = BaseCommonRepository <T> .BaseRepository();

            ReturnOutput returnOutput = new ReturnOutput();

            T      entity = repository.FindById(id, ref returnOutput);
            object value  = new object();

            value = (object)isDeleted;

            var item = entity.GetType().GetProperty("IsDeleted");

            item.SetValue(entity, value);

            repository = BaseCommonRepository <T> .BaseRepository();

            var retVal = repository.Update(entity, ref returnOutput);

            return(returnOutput);
        }