Esempio n. 1
0
 public IssueDto(Issue issue)
 {
     this.Id = issue.Id;
     this.ReportedByProfileId = issue.ReportedById;
     this.Subject = issue.Subject;
     this.Content = issue.Content;
     this.IssueStatus = issue.IssueStatus;
 }
        public IHttpActionResult Add(IssueRequestDto dto)
        {
            var currentProfile = uow.Accounts
                .GetAll()
                .Include(x => x.Profiles)
                .Where(x => x.Email == User.Identity.Name)
                .Single()
                .Profiles.First();

            var issue = new Issue()
            {

                ReportedById = currentProfile.Id,
                Subject = dto.Subject,
                Content = dto.Content,
                IssueStatus = IssueStatus.New
            };

            uow.Issues.Add(issue);
            uow.SaveChanges();

            return Ok();
        }