Beispiel #1
0
        private Profession ProfessionMapping(ProfessionView prof, HttpPostedFileBase file)
        {
            var profession = new Profession();
            profession.ImageData = new byte[file.ContentLength];
            profession.MimeType = file.ContentType;
            profession.Name = prof.Name;
            profession.Description = prof.Description;
            profession.ProfCathegoryId = prof.ProfCathegoryId;
            profession.VideoLinkId = prof.VideoLinkId;

            file.InputStream.Read(profession.ImageData, 0, file.ContentLength);

            return profession;
        }
Beispiel #2
0
        public Profession GetByName(string name)
        {
            var item = _unitOfWork.Get<Profession>().Where(a => a.Name == name).Select(a => new
            {
                Id = a.Id,
                Name = a.Name,
                Description = a.Description,
                ProfCathegoryId = a.ProfCathegoryId,
                VideoLinkId = a.VideoLinkId
            }).FirstOrDefault();

            var profession = new Profession()
            {
                Id = item.Id,
                Name = item.Name,
                Description = item.Description,
                ProfCathegoryId = item.ProfCathegoryId,
                VideoLinkId = item.VideoLinkId
            }; return profession;
        }
Beispiel #3
0
 public void CreateProfession(Profession prof)
 {
     _unitOfWork.Add<Profession>(prof);
 }