public static Event FromRow(this Event evt, DataRow row) { evt.AccountId = row.GetIntField("AccountId"); evt.CodeId = row.GetIntField("CodeId"); evt.Type = (EventType)row.GetByteField("EventTypeId"); evt.Payload = row.GetStringField("Payload"); return evt; }
public static Account FromRow(this Account acct, DataRow row) { acct.Id = row.GetIntField("Id"); acct.Name = row.GetStringField("Name"); acct.Email = row.GetStringField("Email"); acct.Status = (AccountStatusType)(row.GetByteField("StatusId")); acct.ClientInfo = row.GetStringField("ClientInfo"); return acct; }
public static Code FromRow(this Code code, DataRow row) { code.AccountId = row.GetIntField("AccountId"); code.CodeId = row.GetIntField("CodeId"); code.Type = (CodeType)row.GetByteField("CodeTypeId"); code.Rectangle = JsonConvert.DeserializeObject<Rectangle>(row.GetStringField("CodeRectangle")); code.BackgroundContentType = row.GetStringField("BackgroundContentType"); code.Payload = JsonHelper.Deserialize(row.GetStringField("Payload"), code.Type); return code; }