Comments (8)
Have you also exported base classes/interfaces?
from reinforced.typings.
Yes i did. I'll just go ahead and drop my entire code here for you to see.
Thanks for the speedy response.
public static class ReinforcedTypings
{
public static void Configure(ConfigurationBuilder config)
{
var polluxBase = typeof(PolluxEntity<>);
var types = new[] { polluxBase }.Concat(
polluxBase
.Assembly
.GetTypes()
.Where(_t => _t.IsClass)
.Where(_t => _t != polluxBase)
.Where(_t => _t.HasGenericAncestor(polluxBase))); //filters classes who's generic ancestor has the argument as it's generic definition
config.ExportAsInterfaces(types, _icb =>
{
_icb.OverrideNamespace("Pollux.Models")
.WithPublicProperties();
});
}
}
Examples of classes being exported are below
public abstract class PolluxEntity<Key>
{
public Key EntityId { get; set; }
public DateTime CreatedOn { get; set; }
public DateTime? ModifiedOn { get; set; }
public PolluxEntity()
{
this.CreatedOn = DateTime.Now;
}
}
public class ContactData: PolluxEntity<long>
{
public string Phone { get; set; }
public string AlternatePhone { get; set; }
public bool PhoneConfirmed { get; set; }
public string Email { get; set; }
public string AlternateEmail { get; set; }
public bool EmailConfirmed { get; set; }
public virtual string OwnerId { get; set; }
public ContactData()
{
}
}
...and many other such model/entity classes.
But the final result looks like this:
export interface IPolluxEntity<Key>
{
EntityId: Key;
CreatedOn: any;
ModifiedOn?: any;
}
export interface IContactData
{
Phone: string;
AlternatePhone: string;
PhoneConfirmed: boolean;
Email: string;
AlternateEmail: string;
EmailConfirmed: boolean;
OwnerId: string;
}
I'm wondering what i'm missing...
Many thanks again in advance.
from reinforced.typings.
Ok, I will check little bit later. Now I dont have enough time
from reinforced.typings.
Ok, your issue is fixed in 1.30 branch. Please check out this branch and run your test.
from reinforced.typings.
Will do.
Cheers.
from reinforced.typings.
If you come up with some other cases to test - feel free to add your tests and contribute.
You will speed up release of 1.3 and also improve stability
from reinforced.typings.
I'll be glad to.
from reinforced.typings.
Fixed in 1.3.0
from reinforced.typings.
Related Issues (20)
- v1.6.1 does not support .NET 7 HOT 23
- Invalid code generated for explicit interface member implementation
- Export public static properties of static class to enum HOT 2
- Add raw line to output file (for example to disable eslint errors) HOT 3
- Is it possible to generate union?
- RT0999: Input string was not in a correct format.
- Are SDK Projects supported? HOT 3
- MSB6006 "" exited with code -214745073
- Issue when base class is exported as interface HOT 1
- feat: Net8 support HOT 24
- <RtDisable> and <TreatWarningsAsError> not working HOT 1
- Error MSB6006: "" exited with code 1. HOT 2
- The AddImports feature should allow you to select what quotes to use
- Generated Typescript loses information about combined enum flags when using UseString
- Improved compilation of JSDOC
- JSDOC for enums
- Add a custom property to a class HOT 4
- feat: Net9 support
- Empty file generated?
- Generate `type`s instead of `interface`s and `enum`s
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reinforced.typings.