public static bll.Category ToBLL(this dto.Category dto)
        {
            bll.Category bll = new bll.Category();

            bll.Id          = dto.Id;
            bll.Name        = dto.Name;
            bll.Type        = dto.Type;
            bll.Description = dto.Description;
            bll.CreateDate  = dto.CreateDate;
            bll.CreateBy    = dto.CreateBy;

            return(bll);
        }
        public static dto.Category ToDTO(this bll.Category bll)
        {
            dto.Category dto = new dto.Category();

            dto.Id          = bll.Id;
            dto.Name        = bll.Name;
            dto.Type        = bll.Type;
            dto.Description = bll.Description;
            dto.CreateDate  = bll.CreateDate;
            dto.CreateBy    = bll.CreateBy;

            return(dto);
        }
Esempio n. 3
0
        public ICollection <Category> GetAllCategorys()
        {
            List <BLL.Models.Category> list = new List <BLL.Models.Category>();

            foreach (var item in _dal.GetAllCategorys())
            {
                var category = new BLL.Models.Category
                {
                    Id          = item.Id,
                    Name        = item.Name,
                    Desctiption = item.Desctiption,
                    Image       = item.Image
                };
                list.Add(category);
            }
            return(list);
        }