@@ -104,6 +104,60 @@ public partial class ProductRenamed
104104" ;
105105 }
106106
107+ private static class ExpectedEntitiesNoEncoding
108+ {
109+ public const string CategoryClass =
110+ @"using System;
111+ using System.Collections.Generic;
112+
113+ namespace FakeNamespace
114+ {
115+ /// <summary>
116+ /// 产品
117+ /// </summary>
118+ public partial class Category : Entity<int>
119+ {
120+ public Category()
121+ {
122+ Products = new HashSet<Product>();
123+ }
124+
125+ public int CategoryId { get; set; }
126+
127+ /// <summary>
128+ /// The name of a category
129+ /// </summary>
130+ public string CategoryName { get; set; }
131+
132+ public virtual ICollection<Product> Products { get; set; }
133+ }
134+ }
135+ " ;
136+
137+ public const string ProductClass =
138+ @"using System;
139+ using System.Collections.Generic;
140+
141+ namespace FakeNamespace
142+ {
143+ /// <summary>
144+ /// 产品
145+ /// </summary>
146+ public partial class Product : Entity<int>
147+ {
148+ public int ProductId { get; set; }
149+ public string ProductName { get; set; }
150+ public decimal? UnitPrice { get; set; }
151+ public bool Discontinued { get; set; }
152+ public byte[] RowVersion { get; set; }
153+ public int? CategoryId { get; set; }
154+
155+ public virtual Category Category { get; set; }
156+ }
157+ }
158+ " ;
159+ }
160+
107161 private static class ExpectedEntitiesWithAnnotations
108162 {
109163 public const string CategoryClass =
@@ -248,6 +302,79 @@ public partial class ProductRenamed
248302" ;
249303 }
250304
305+ private static class ExpectedEntitiesWithAnnotationsNoEncoding
306+ {
307+ public const string CategoryClass =
308+ @"using System;
309+ using System.Collections.Generic;
310+ using System.ComponentModel.DataAnnotations;
311+ using System.ComponentModel.DataAnnotations.Schema;
312+ using Microsoft.EntityFrameworkCore;
313+
314+ namespace FakeNamespace
315+ {
316+ /// <summary>
317+ /// 产品
318+ /// </summary>
319+ [Table(""Category"")]
320+ public partial class Category : Entity<int>
321+ {
322+ public Category()
323+ {
324+ Products = new HashSet<Product>();
325+ }
326+
327+ [Key]
328+ public int CategoryId { get; set; }
329+
330+ /// <summary>
331+ /// The name of a category
332+ /// </summary>
333+ [Required]
334+ [StringLength(15)]
335+ public string CategoryName { get; set; }
336+
337+ [InverseProperty(nameof(Product.Category))]
338+ public virtual ICollection<Product> Products { get; set; }
339+ }
340+ }
341+ " ;
342+
343+ public const string ProductClass =
344+ @"using System;
345+ using System.Collections.Generic;
346+ using System.ComponentModel.DataAnnotations;
347+ using System.ComponentModel.DataAnnotations.Schema;
348+ using Microsoft.EntityFrameworkCore;
349+
350+ namespace FakeNamespace
351+ {
352+ /// <summary>
353+ /// 产品
354+ /// </summary>
355+ [Table(""Product"")]
356+ [Index(nameof(CategoryId), Name = ""IX_Product_CategoryId"")]
357+ public partial class Product : Entity<int>
358+ {
359+ [Key]
360+ public int ProductId { get; set; }
361+ [Required]
362+ [StringLength(40)]
363+ public string ProductName { get; set; }
364+ [Column(TypeName = ""money"")]
365+ public decimal? UnitPrice { get; set; }
366+ public bool Discontinued { get; set; }
367+ public byte[] RowVersion { get; set; }
368+ public int? CategoryId { get; set; }
369+
370+ [ForeignKey(nameof(CategoryId))]
371+ [InverseProperty(""Products"")]
372+ public virtual Category Category { get; set; }
373+ }
374+ }
375+ " ;
376+ }
377+
251378 private static class ExpectedEntitiesWithNullableNavigation
252379 {
253380 public const string CategoryClass =
0 commit comments