public bool RecordVisitor(Domain.Entities.Visitors visitor)
 {
     try
     {
         _societyManagementDbContext.Visitorses.Add(visitor);
         _societyManagementDbContext.SaveChanges();
         return(true);
     }catch (Exception ex)
     {
         return(false);
     }
 }
        public bool RecordVisitor(Visitors visitor)
        {
            var visitorEntity = new Domain.Entities.Visitors()
            {
                CheckInStatus = visitor.CheckInStatus,
                Idproof       = 1,
                InDateTime    = DateTime.Now,
                MobileNumber  = visitor.MobileNumber,
                Name          = visitor.VisitorFullName,
                OutDateTime   = DateTime.Now,
                ReasonToVisit = visitor.ReasonToVisit,
                SocietyFlatId = visitor.VisitFlatNumber,
            };

            visitorEntity.ImageId = visitor.ImageId == 0 && visitor.ImageData != null?AddImage(visitor.ImageData) : visitor.ImageId;

            return(_visitorRepository.RecordVisitor(visitorEntity));
        }