public static requirement ToRequirement(this NewServeEventModel._RequirementModel model, MemberModel member)
        {
            if (model == null) return null;

            var entity = new requirement
            {
                ID = model.ID,
                IsPrivate = model.IsPrivate,
                MemberID = member.MemberID,
                MemberName = member.MemberName,
                RequirementTypeName = model.RequirementTypeName,
                Status = model.Status,
                Title = model.Title,
                Description = model.Description,

            };

            if (member.DefaultGroup != null)
            {
                entity.GroupID = member.DefaultGroup.GroupID;
                entity.GroupName = member.DefaultGroup.GroupName;
            }

            return entity;
        }
        public static requirement ToRequirementEntity(this RequirementBasicModel model)
        {
            if (model == null) return null;

            var entity = new requirement
            {
                ID = model.ID,
                IsPrivate = model.IsPrivate,
                MemberID = model.MemberID,
                MemberName = model.MemberName,
                RequirementTypeName = model.RequirementTypeName,
                Status = model.Status,
                Title = model.Title,
                Description = model.Description,
                GroupID = model.GroupID,
                GroupName = model.GroupName
            };

            return entity;
        }
 public requirement NewMemberRequirement(requirement req)
 {
     try
     {
         var entity = _requirementRepo.Create(req);
         _fsllDB.SaveChanges();
         return entity;
     }
     catch
     {
         throw;
     }
 }
 private void addRequirement(requirement req)
 {
     _requirementRepo.Create(req);
     _fsllDB.SaveChanges();
 }
        public requirement UpdateMemberRequirement(requirement req)
        {
            var entity = req;
            if (req.ID == 0)
            {
                req.CreatedDate = DateTime.Now;
                entity = NewMemberRequirement(req);
            }
            else
            {
                _requirementRepo.Update(req);
                _fsllDB.SaveChanges();
            }

            return entity;
        }