erstellen der Buch und Magazin Models

This commit is contained in:
Naumann 2020-05-27 08:38:40 +02:00
parent 4320a1d948
commit a543c8c1bd
6 changed files with 47 additions and 54 deletions

View file

@ -1,39 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
namespace BuecherwurmAPI.Controllers
{
[ApiController]
[Route("[controller]")]
public class WeatherForecastController : ControllerBase
{
private static readonly string[] Summaries = new[]
{
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
};
private readonly ILogger<WeatherForecastController> _logger;
public WeatherForecastController(ILogger<WeatherForecastController> logger)
{
_logger = logger;
}
[HttpGet]
public IEnumerable<WeatherForecast> Get()
{
var rng = new Random();
return Enumerable.Range(1, 5).Select(index => new WeatherForecast
{
Date = DateTime.Now.AddDays(index),
TemperatureC = rng.Next(-20, 55),
Summary = Summaries[rng.Next(Summaries.Length)]
})
.ToArray();
}
}
}

19
Models/Buch_Command.cs Normal file
View file

@ -0,0 +1,19 @@
namespace BuecherwurmAPI.Models
{
public class Book
{
public string Name {get; set;}
public string Author {get; set;}
public string Country {get; set;}
public string Link {get; set;}
public string Language {get; set;}
public int Pages {get; set;}
public int Year {get; set;}
public int ProductId { get; set; }
public CategoryEnum Category { get; set; }
public string ImageLink { get; set; }
public int LendTime {get; set;}
// public LendTypeEnum LendType {get; set;}
}
}

11
Models/CategoryEnum.cs Normal file
View file

@ -0,0 +1,11 @@
namespace BuecherwurmAPI.Models
{
public enum CategoryEnum
{
Book,
Magazine,
EBook,
EPaper
}
}

17
Models/Magazin_Command.cs Normal file
View file

@ -0,0 +1,17 @@
namespace BuecherwurmAPI.Models
{
public class Magazine
{
public int ProductId {get; set;}
public CategoryEnum Category {get; set;}
public int LendTime {get; set;}
public string Name {get; set;}
public string Run {get; set;}
public string Audience {get; set;}
public string Topic {get; set;}
// public LendTypeEnum LendType {get; set;}
}
}

View file

@ -1,15 +0,0 @@
using System;
namespace BuecherwurmAPI
{
public class WeatherForecast
{
public DateTime Date { get; set; }
public int TemperatureC { get; set; }
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
public string Summary { get; set; }
}
}