public async Task <ResponseDataViewModel> UpdateContact([FromBody] List <ContactViewModel> mContact)
        {
            _logger.LogInformation("Update contact list from method UpdateContact()");
            var eContact = AutoMapConverter.ConvertObjectCollection <ContactViewModel, Contact>(mContact);
            var result   = await _contactServiceAgent.UpdateContact(eContact);

            _logger.LogInformation("Update contact list from method UpdateContact() Successful");
            return(AutoMapConverter.ConvertObject <ResponseData, ResponseDataViewModel> (result));
        }
        public ContactListResponse GetContactList()
        {
            var resp = new ContactListResponse();
            resp.Contacts = new Models.Contacts();           

            IContactBS bs = DIFactoryDesigntime.GetInstance<IContactBS>();
            IList<Entities.Contact> rtnList = bs.GetContacts();
            IBaseConverter<Entities.Contact, Models.Contact> convtResult = new AutoMapConverter<Entities.Contact, Models.Contact>();
            var convtList = convtResult.ConvertObjectCollection(rtnList);
            resp.Contacts.AddRange(convtList);           
            return resp;           
        }
        public async Task <ContactViewModelResponse> GetContactList()
        {
            _logger.LogInformation("Get contact list from method getcontactlist()");
            var resp = new ContactViewModelResponse()
            {
                ContactList = new List <ContactViewModel>()
            };
            var rtnList = await _contactServiceAgent.GetContacts();

            resp.ContactList = AutoMapConverter.ConvertObjectCollection <Contact, ContactViewModel>(rtnList);
            _logger.LogInformation("Get contact list from method getcontactlist successful");
            return(resp);
        }
Exemplo n.º 4
0
        public ContactListResponse GetContactList()
        {
            var resp = new ContactListResponse();

            resp.Contacts = new Models.Contacts();

            IContactBS bs = DIFactoryDesigntime.GetInstance <IContactBS>();
            IList <Entities.Contact> rtnList = bs.GetContacts();
            IBaseConverter <Entities.Contact, Models.Contact> convtResult = new AutoMapConverter <Entities.Contact, Models.Contact>();
            var convtList = convtResult.ConvertObjectCollection(rtnList);

            resp.Contacts.AddRange(convtList);
            return(resp);
        }
        public async Task <AddContactsResponse> AddContacts([FromBody] List <ContactViewModel> mContact)
        {
            _logger.LogInformation("Add contact list from method AddContacts()");
            var eContact = AutoMapConverter.ConvertObjectCollection <ContactViewModel, Contact>(mContact);
            var result   = await _contactServiceAgent.AddContact(eContact);

            var addContactResponse = new Models.AddContactsResponse()
            {
                ContactIdList = result
            };

            _logger.LogInformation($"Add contact list from method AddContacts() successful with count : {addContactResponse?.ContactIdList.Count}");
            return(addContactResponse);
        }