Esempio n. 1
0
        public static StationContactPayload GetStationContact(int contactId)
        {
            var contact = StationContact.AllStationContacts.FirstOrDefault(x => x.ContactID == contactId);

            if (contact == null)
            {
                return(null);
            }
            return(StationContactPayload.FromStationContact(contact));
        }
Esempio n. 2
0
        public static StationContactPayload UpdateStationContact(int contactId, StationContactPayload updates)
        {
            var contact = StationContact.AllStationContacts.FirstOrDefault(x => x.ContactID == contactId);

            if (contact == null)
            {
                return(null);
            }

            StationContactsModel.WriteStationContactProperties(contact, updates);
            return(StationContactPayload.FromStationContact(contact));
        }
Esempio n. 3
0
 public static IList <StationContactPayload> GetStationContacts()
 {
     return(StationContact.AllStationContacts.Select(contact => StationContactPayload.FromStationContact(contact)).ToList());
 }