public bool Delete(UserMessage record)
        {
            MYS_MESSAGE updatedRecord = UserMessageMapper.ConvertToDBRecord(record);
            var         dbRecord      = Container.Table_Message.Attach(updatedRecord);

            updatedRecord.Status = Constants.MESSAGESTATUS_DELETED;

            return(Container.SaveChanges() == 1);
        }
        public UserMessage Update(UserMessage record)
        {
            MYS_MESSAGE updatedRecord = UserMessageMapper.ConvertToDBRecord(record);
            var         dbRecord      = Container.Table_Message.Attach(updatedRecord);

            if (Container.SaveChanges() == 1)
            {
                record.Id = dbRecord.Id;
            }
            return(record);
        }
        public UserMessage BulkUpdateByUser(UserMessage record)
        {
            MYS_MESSAGE updatedRecord = UserMessageMapper.ConvertToDBRecord(record);

            Container.Table_Message.Where(x => x.UserId.Equals(record.UserId)).ToList().ForEach(y => Container.Table_Message.Attach(y));

            if (Container.SaveChanges() == 0)
            {
                throw new Exception("Silinecek kayıt bulunamadı.");
            }
            return(record);
        }
        public UserMessage Insert(UserMessage record)
        {
            MYS_MESSAGE newRecord = UserMessageMapper.ConvertToDBRecord(record);

            var dbRecord = Container.Table_Message.Add(newRecord);

            if (Container.SaveChanges() == 1)
            {
                record.Id = dbRecord.Id;
            }

            return(record);
        }