public static string ParseStr(MoneyValue amountStr) { //var splittedAmount = amountStr.Split(' '); //string currency = splittedAmount[1]; //Decimal value = Decimal.Parse(splittedAmount[0]); return("a"); }
public async Task <bool> CarReserveAsync(Guid CarId, MoneyValue MoneyValue, DateTime RentalDate, DateTime DevolutionDate) { Reserve Reserve = new Reserve(); Reserve.Id = Guid.NewGuid(); var reserve = new Reserve(); reserve.CarId = CarId; reserve.ActionType = CarType.Job; reserve.RentalDate = RentalDate; reserve.DevolutionDate = DevolutionDate; reserve.Value = MoneyValue; await _ReserveRepository.CreateAsync(Reserve); return(await _ReserveRepository.SaveChangesAsync() > 0); }
public static MoneyValue Sum <T>(this IEnumerable <T> source, Func <T, MoneyValue> selector) { return(MoneyValue.Of(source.Select(selector).Aggregate((x, y) => x + y))); }
public static MoneyValue Of(MoneyValue value) { return(new MoneyValue(value.Value, value.Currency)); }
public MoneyValueOperationMustBePerformedOnTheSameCurrencyRule(MoneyValue left, MoneyValue right) { _left = left; _right = right; }