private ProfCathegory ProfCathegoryMapping(ProfCathegoryView prof, HttpPostedFileBase file) { var profCathegory = new ProfCathegory(); profCathegory.ImageData = new byte[file.ContentLength]; profCathegory.MimeType = file.ContentType; profCathegory.Name = prof.Name; profCathegory.Description = prof.Description; file.InputStream.Read(profCathegory.ImageData, 0, file.ContentLength); return profCathegory; }
public ProfCathegory GetByName(string name) { var prof = _unitOfWork.Get<ProfCathegory>().Where(a => a.Name == name).Select(b => new { Id = b.Id, Name = b.Name, Description = b.Description }).FirstOrDefault(); var professionCathegory = new ProfCathegory() { Id = prof.Id, Name = prof.Name, Description = prof.Description }; return professionCathegory; }
public void CreateProfCathegory(ProfCathegory model) { _unitOfWork.Add<ProfCathegory>(model); }