public static Dictionary ToDomain(this tbWordlist item) { return(new Dictionary { Id = item.id, Name = item.name, Created = item.created }); }
public void Create(Dictionary dictionary) { dictionary.Id = 0; dictionary.Created = DateTime.Now; var itemToInsert = new tbWordlist(); dictionary.FillDbObject(itemToInsert); DataContext.tbWordlists .InsertOnSubmit(itemToInsert); DataContext.SubmitChanges(); dictionary.Id = itemToInsert.id; }
public static void FillDbObject(this Dictionary from, tbWordlist to) { to.id = from.Id; to.name = from.Name; to.created = from.Created; }