Open chrisrrowland opened 4 years ago
you can check my solution if it will help https://github.com/AdaskoTheBeAsT/netcoretypewriterrecipes/blob/master/Angular/AutogeneratedModels.tst
you can check my solution if it will help https://github.com/AdaskoTheBeAsT/netcoretypewriterrecipes/blob/master/Angular/AutogeneratedModels.tst
Thanks, I'm trying to tweak that to work with the minor modifications I had. It is generating .ts files but it's not importing anything.
I had tried removing the bits for IncludeClass/IncludeEnums since my model classes didn't end with Model, but even when I renamed one to end with Model and retained those it still didn't produce any import statements.
I believe I wasn't actually triggering the correct code to run. When I changed that, it is giving me the error
10:40:35.168 ERROR: Error rendering template. Cannot get identifier 'GenerateTypeInit'. Source path: CollectionModel.cs System.ArgumentOutOfRangeException: Length cannot be less than zero.
That class just looks like
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace ReportPortalAPI.Controllers.v1.Model
{
public class CollectionModel
{
public Guid Id { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public string CreatedByUniqname { get; set; }
}
}
hi I will try to dig into this on the weekend and I will get back to you
hi - sorry for long delay in method GenerateTypeInit replace var pos = c.FullName.IndexOf(".Models"); with var pos = c.FullName.IndexOf(".Model");
on last line please add finishing }
you can start from here
Perhaps I'm just doing something incorrectly, but if I have a cs class like
Similarly there is a .cs file for Collections. then the generated code is like so
The Collections.ts is generated but not imported. Is it wrong to think it should be? Is there a way to configure this?