public EventRest(Event source) { Id = source.Id; Name = source.Name; Description = source.Description; StartDate = JsonDate.ToString(source.StartDate); Bros = source.Bros.Select(b => b.Id).ToList(); }
public TransactionRest(Transaction transaction) { Id = transaction.Id; Date = JsonDate.ToString(transaction.Date); Amount = transaction.Amount; Rate = transaction.Rate.ToString(CultureInfo.InvariantCulture); Currency = transaction.Currency.Id; Source = transaction.Source.Id; Targets = transaction.Targets.Select(t => t.Id).ToList(); Event = transaction.Event != null ? transaction.Event.Id : (int?)null; Comment = transaction.Comment; }
public ExchangeRateRest(ExchangeRate rate) { Currency = rate.Currency.Id; Date = JsonDate.ToString(rate.Date); Rate = rate.Rate; }