Beispiel #1
0
 private static void FormatVcard(StringBuilder buffer, Database.Models.Person contact, ILogger logger)
 {
     buffer.AppendLine("BEGIN:VCARD");
     buffer.AppendLine("VERSION:2.1");
     buffer.AppendFormat($"N:{contact.LastName};{contact.FirstName}\r\n");
     buffer.AppendFormat($"FN:{contact.FirstName} {contact.LastName}\r\n");
     buffer.AppendFormat($"UID:{contact.BusinessEntityId}\r\n");
     buffer.AppendLine("END:VCARD");
     logger.LogInformation($"Writing {contact.FirstName} {contact.LastName}");
 }
Beispiel #2
0
        public void SavePerson(Person person)
        {
            Database.Models.Person dbPerson = NetCoreAngularDbContext.People.FirstOrDefault(x => x.Id == person.Id);

            if (dbPerson == null)
            {
                NetCoreAngularDbContext.People.Add(dbPerson = new Database.Models.Person()
                {
                    Id = person.Id
                });
            }

            Mapper.Map(person, dbPerson);

            NetCoreAngularDbContext.SaveChanges();
        }