0

I want to add new API to ASP.NET Boilerplate's template for ASP.NET Core.

I've tried to make it, but I always get response code 500 on Swagger. How can I add new API?

Error 500 on Swagger

Update

Mvc.ExceptionHandling.AbpExceptionFilter - Can't create component 'CityInfo.Models.TempatManager' as it has dependencies to be satisfied.

'CityInfo.Models.TempatManager' is waiting for the following dependencies: - Service 'Abp.Domain.Repositories.IRepository`1[[CityInfo.Models.Tempat, CityInfo.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]' which was not registered.

aaron
  • 39,695
  • 6
  • 46
  • 102
  • This is just a wall of code and a wish list, what is the question? Where are you having a problem? What have you tried? – Ron Beyer Feb 27 '18 at 04:55
  • Hi, welcome to stack overflow. Please refer the [ask] link for more details on how to ask a question and update your question accordingly. – Jeroen Heier Feb 27 '18 at 04:55
  • Check the error in Logs.txt. – aaron Feb 27 '18 at 05:00
  • the question is, How to add new api in asp boilerplate? that's code it's my effort. – Yogi Chandra Feb 27 '18 at 05:04
  • Mvc.ExceptionHandling.AbpExceptionFilter - Can't create component 'CityInfo.Models.TempatManager' as it has dependencies to be satisfied. @aaron – Yogi Chandra Feb 27 '18 at 05:20
  • Which dependencies? – aaron Feb 27 '18 at 05:45
  • 'CityInfo.Models.TempatManager' is waiting for the following dependencies: - Service 'Abp.Domain.Repositories.IRepository`1[[CityInfo.Models.Tempat, CityInfo.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]' which was not registered. @aaron – Yogi Chandra Feb 27 '18 at 05:49

2 Answers2

1

CityInfo.Models.TempatManager is waiting for CityInfo.Models.Tempat which was not registered.

So what you have to do; Inherit Tempat from Entity or FullAuditedEntity

public class Tempat  : FullAuditedEntity
{
     //.....
}

and add this to your DbContext

public virtual DbSet<Tempat> Tempats { get; set; }

Further info, read: https://aspnetboilerplate.com/Pages/Documents/Entities

Alper Ebicoglu
  • 8,884
  • 1
  • 49
  • 55
0

Your entity class (Tempat) has probably not been added to your DbContext.

Just add the following property to your DbContext class and you should be good to go:

public virtual IDbSet<CityInfo.Models.Tempat> Tempat { get; set; }

Jacques Snyman
  • 4,115
  • 1
  • 29
  • 49