Beispiel #1
0
 public void Add(LeadTypeModel model)
 {
     var leadType = new LeadType();
     leadType.Name = model.Name;
     leadType.IsDeleted = false;
     foreach (var tag in model.TagsId)
     {
         leadType.LeadTags.Add(_tagBusinessLogic.GetById(tag));
     }
     //leadType.LeadTags.AddRange(model.Tags);
     _leadTypeBusinessLogic.Add(leadType);
 }
Beispiel #2
0
 public static LeadTypeModel ConvertToModel(this LeadType source)
 {
     var model = new LeadTypeModel
     {
         Id = source.Id,
         Name = source.Name,
         //Tags = source.LeadTags.Aggregate((a, b) => a.Name + ", " + b.Name)
     };
     foreach (var leadTag in source.LeadTags)
     {
         model.Tags += leadTag.Name + ", ";
     }
     model.Tags.Remove(model.Tags.Length - 2);
     return model;
 }