Пример #1
0
            public List <FileDependencyModel> ReadLike(FileDependencyModel modelo)
            {
                var bd = new BDConnection.BDConnection();


                var lista = new List <FileDependencyModel>();


                var     config  = new MapperConfiguration(cfg => cfg.CreateMap <FileDependencyModel, FileDependencyModel>());
                IMapper iMapper = config.CreateMapper();

                try
                {
                    foreach (var item in bd.ReadLike <FileDependencyModel>(modelo))
                    {
                        lista.Add(iMapper.Map <object, FileDependencyModel>(item));
                    }
                }
                catch (Exception e)
                {
                    return(null);
                }


                return(lista);
            }
Пример #2
0
            public bool Edit(FileDependencyModel modelo, long id)
            {
                var bd = new BDConnection.BDConnection();


                modelo.FileDependencyId = id;

                return(bd.Edit <FileDependencyModel>(modelo, id.ToString()));
            }
Пример #3
0
            public FileDependencyModel Read(FileDependencyModel modelo)
            {
                var     bd      = new BDConnection.BDConnection();
                var     config  = new MapperConfiguration(cfg => cfg.CreateMap <FileDependencyModel, FileDependencyModel>());
                IMapper iMapper = config.CreateMapper();
                var     f       = iMapper.Map <object, FileDependencyModel>(bd.ReadWhere <FileDependencyModel>(modelo));


                return(f);
            }
Пример #4
0
            public bool Add(FileDependencyModel modelo)
            {
                var bd = new BDConnection.BDConnection();


                var res = bd.Add <FileDependencyModel>(modelo);


                return(res);
            }
Пример #5
0
            public bool Delete(long id)
            {
                var bd = new BDConnection.BDConnection();


                var modelo = new FileDependencyModel();

                modelo.FileDependencyId = id;


                var g = bd.DeletePost <FileDependencyModel>(modelo, id);



                return(g);
            }