Skip to content

Child class in parent class should be lowercase #40

@jjhii

Description

@jjhii

Installed product versions

  • Visual Studio: [example 2017 15.7.4]
  • This extension: [1.1.24]

Description

Parent class uses child class name with uppercase but child class is lowercase when [NotMapped] is used. If [NotMapped] is not used then the child class is not strongly typed.

Note: Please tell me if I am just doing this the wrong way round.

Note: Currently I just change the uppercase character to lowercase and it works find until the type is regenerated, so mostly it is just annoying. But I can see on larger project where this could be problematic.

Steps to recreate

Create a class and child class and generate a typedef for the classes.

Current behavior

Case 1:

public class Child
{
public int Id { get; set; }
public int Count { get; set; }
}
public class Parent
{
public int Id { get; set; }
public Child[] Children {get;set;}
}

declare module server {
interface child {
id: number;
count: number;
}
interface parent {
id: number;
children: { // would like it to be a strongly typed array.
id: number;
count: number;
}[];
}
}

Case 2:

public class Child
{
public int Id { get; set; }
public int Count { get; set; }
}
public class Parent
{
public int Id { get; set; }
[NotMapped]
public Child[] Children {get;set;}
}
Generated code
declare module server {
interface child {
id: number;
count: number;
}
interface parent {
id: number;
children: server.Child[]; // should be lowercase to match generated child class name.
}
}

Error TS2694 (TS) Namespace 'server' has no exported member 'Child'.

Expected behavior

I think the child class name in the parent class should be lowercase, not uppercase.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions