//To Add new People record public int AddPeople(PeopleDto PeopleDto) { try { People People = new People { FirstName = PeopleDto.FirstName, MiddleName = PeopleDto.MiddleName, SurName = PeopleDto.SurName, OrganisationId = PeopleDto.OrganisationId, Gender = PeopleDto.Gender, UserId = PeopleDto.UserId, }; //Images img = new Images //{ // ImageDescription = "test", // ImageFile = (byte)PeopleDto.ImageFile, // IsProfilePic = PeopleDto.IsProfilePic, //}; //People.Images.Add(img); db.People.Add(People); db.SaveChanges(); return(People.Id); } catch { throw; } }
public int AddImages(Images image) { try { db.Images.Add(image); db.SaveChanges(); return(1); } catch (Exception ex) { throw; } }