Browse Source

erstellen der Buch und Magazin Models

Felix_TestBranch
Naumann 2 years ago
parent
commit
a543c8c1bd
  1. 39
      Controllers/WeatherForecastController.cs
  2. 19
      Models/Buch_Command.cs
  3. 11
      Models/CategoryEnum.cs
  4. 17
      Models/Magazin_Command.cs
  5. 15
      WeatherForecast.cs
  6. BIN
      obj/Debug/netcoreapp3.1/BuecherwurmAPI.csprojAssemblyReference.cache

39
Controllers/WeatherForecastController.cs

@ -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

@ -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

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

17
Models/Magazin_Command.cs

@ -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;}
}
}

15
WeatherForecast.cs

@ -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; }
}
}

BIN
obj/Debug/netcoreapp3.1/BuecherwurmAPI.csprojAssemblyReference.cache

Binary file not shown.
Loading…
Cancel
Save