Пример #1
0
        /// <summary>
        /// Add Contact
        /// </summary>
        /// <param name="contactRequest">contactRequest</param>
        /// <returns>Returns true if addition is successful else false</returns>
        public async Task <bool> AddContact(ContactRequest contactRequest)
        {
            ContactValidator contactValidator = new ContactValidator(eHIDemoContext);

            contactValidator.ValidateContactRequest(contactRequest);

            ContactDAL contactDAL = new ContactDAL(eHIDemoContext);

            DBModel.Contact.Contact contact = ContactMapper.MapperForContactAdd(contactRequest);
            int savedRecordCount            = await contactDAL.AddContact(contact).ConfigureAwait(false);

            if (savedRecordCount > 0)
            {
                return(true);
            }
            return(false);
        }