Ejemplo n.º 1
0
        public int AddReport(AppReport report)
        {
            Domain.MainBoundedContext.Reports.Aggregates.Report r = report.ToReport();

            // owners
            r.Owners = new List <User>();
            foreach (var o in report.Owners)
            {
                r.Owners.Add(_userRepository.GetFiltered((u) => u.Id == o.Id).FirstOrDefault());
            }

            // team
            // r.TeamSite = _teamRepository.Get(report.Team.Id.GetValueOrDefault());

            // category
            r.Catagories = new List <Category>();
            foreach (var category in report.Categories)
            {
                r.Catagories.Add(_categoryRepository.Get(category.Id.GetValueOrDefault()));
            }

            // Tags
            r.Tags = new List <Tag>();
            foreach (var t in report.Tags)
            {
                r.Tags.Add(_tagRepository.Get(t.Id.GetValueOrDefault()));
            }


            return(_reportRepository.AddReport(r));
        }
Ejemplo n.º 2
0
 public void RemoveReport(Domain.MainBoundedContext.Reports.Aggregates.Report r)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 3
0
 public int AddReport(Domain.MainBoundedContext.Reports.Aggregates.Report r)
 {
     this.Add(r);
     this.UnitOfWork.Commit();
     return(this.GetFiltered(_ => _.Title == r.Title && _.Description == r.Description && _.TeamSiteId == r.TeamSiteId).FirstOrDefault().Id);
 }