static void Main(string[] args) { var inventory = new ICars[] { new UsedCar {Model="Tesla X", Age=1, Price = 888999m }, new UsedCar {Model="Tesla M",Age=2,Price=898998m }, new NewCars {Model="Tesla X",YearsOfWarranty=3,Price=76786m } }; foreach (var car in inventory) { DisplayCar(car); } }
public CartController(ICars cars, ShopCart shopCart) { _cars = cars; _shopCart = shopCart; }
public CarsController(ICars cars, ICarsCategory carsCategory) { _cars = cars; _carsCategory = carsCategory; }
public HomeController(ILogger <HomeController> logger, ICars Car)//, UseTheForce UseTheForce) { this.Car = Car; _logger = logger; //this.UseTheForce = UseTheForce; }
public ShopCartController(ICars carRepo, ShopCart shopCart) { _carRepo = carRepo; _shopCart = shopCart; }
static void DisplayCar(ICars car) { Console.WriteLine("model:{0},price:{1:c}", car.Model, car.Price); }
/// <param name='operations'> /// Reference to the Offleaseonly.ICars. /// </param> /// <param name='take'> /// Required. /// </param> /// <param name='skip'> /// Required. /// </param> /// <param name='query'> /// Required. /// </param> /// <param name='cancellationToken'> /// Cancellation token. /// </param> public static async Task <IList <Car> > GetAsync(this ICars operations, int take, int skip, string query, CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Microsoft.Rest.HttpOperationResponse <System.Collections.Generic.IList <Offleaseonly.Models.Car> > result = await operations.GetWithOperationResponseAsync(take, skip, query, cancellationToken).ConfigureAwait(false); return(result.Body); }
/// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='query'> /// </param> /// <param name='skip'> /// </param> /// <param name='take'> /// </param> public static IList <CarData> GetOld(this ICars operations, string query = "car.year>0", int?skip = 0, int?take = 10) { return(Task.Factory.StartNew(s => ((ICars)s).GetOldAsync(query, skip, take), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='vin'> /// </param> public static CarData GetByVin(this ICars operations, string vin) { return(Task.Factory.StartNew(s => ((ICars)s).GetByVinAsync(vin), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
public CarsBLL() : base(typeName) { iCars = (ICars)idal; }