Entity Framework? ?? ?? ??: ?? ?? ???
?? ???? ?? ??? ??(ORM)? EF(Entity Framework)? ???? ?? ) .NET ?????? ???? ?? ?? ???? ?? ??? ???? ?? ?????. ????? EF? ???? ??? ? ??? ?? ?? ??? ?? ????? ??? ?????. ??? ? ?? ??? ?? ?? ??? ???? ????? ?? ??? ?? ??? ??? ? ????.
????? ?? ???? ???? ??
????? ??? ? ????. ?? ???? ???? ?? ????? ????. ?? ?? ???? ?? ??? ?? ?? ???? ???? ???? ?? ??????? ?? ???? ?? ?? ???? ??? ??? ? ????. ??????? ?? ??? ???? ??? ? ??? ??? ??? ? ????. ?? ?? ?? ???? ?? ?? ???? ???? EF? ??? ??? ??? ? ????.
??? ??? ??: Unchanged EntityState
?? ??? ???? ???? ??? ????? , EntityState.Unchanged ??? ??? ? ????. ?? ???? ??? Unchanged? ????? ???? ?? ?? ?? EF? ?? ???? ????? ???? ???.
EntityState.Unchanged? ??? ?? ??
??? ?????. ?? ?(City ?? ???? ?? School ???? ??? ??):
public School Insert(School newItem) { using (var context = new DatabaseContext()) { context.Set<School>().Add(newItem); context.Entry(newItem.City).State = EntityState.Unchanged; context.SaveChanges(); return newItem; } }
?? ???? ??? ???? ???? ???? EF? ?? ?? ???? ???? ??????? ???? ?? ??? ???. ??? ? ?? ??? ????? ?? ??? ??? ???? ???? ???.
?? ???: ?? ? ??
?? ???? ??? ???? ?? ?? ???? ????. ?? ??? ??? ?? ? ??? ???? ?? ????? ??? ????? ?????. ?? ?? EF? ??? ??? ???? ??? ???? ??? ???? ?????.
?? ?? ???? ?? ??
??? ?? ?? ???? ?? ?? ??? ????? ?????. :
public class School { public int Id { get; set; } public string Name { get; set; } [ForeignKey("City_Id")] public City City { get; set; } [Required] public int City_Id { get; set; } } public School Insert(School newItem, int cityId) { using (var context = new DatabaseContext()) { // Set child entity to null to prevent insertion newItem.City = null; // Specify foreign key relationship without adding the child entity newItem.City_Id = cityId; context.Set<School>().Add(newItem); context.SaveChanges(); return newItem; } }
? ?? City_Id? ???? ???? City ??? ????? ?????. EF? ?? ???? ???? ?? ?? ?? ?? ??? ?????. ? ?? ??? ???? ??? ????? EntityState? ???? ??? ??? ????.
??
Entity Framework? ?? ??? ???? EntityState.Unchanged? ?? ??? ??? ????? ?? ?? ???? ???? ?? ??? ???? ?? ? ??? ???? ?? ?? ???? ???? ?????? ??? ??? ???? ??? ? ????.
? ??? Entity Framework?? ?? ??? ???? ??? ??? ? ?????? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

??? ??











?, ?? ???? C? ??? ??, ?? ??? ? ??????. 1. ?? ???? ??? ??? ?? ?? ??? ?? ?? ??? ?????. 2. ????? ??? ?? ??? ?? ??? ??? ?? ? ??? ?????. 3. ??? ???? ?? ?? ???? ???? ?? ?? ??? ??? ????? ????? ???? ?????.

C? ? ?? ?? ??? ??? ??? : ??? ?? ??? ? ??? ???. 1. ??? ?? ???? ?? ??? ? ???? ?? ????? ?? ??? ????? ?? ???? ??? ? ????. 2. ??? ???? ?? ?? ? ??? ?? ???? ???? ??? ?? ?? ??? ?????.

?, C? ???? ?? ?????. 1) ??? ??? ?? ?? ? ??? ???? ?????. 2) ?? ???? ???? ??? ????. 3) ?? ??? ????? ??? ?? ???? ??? ??? ? ??????. ?? ? ??? ?? ???? ???? ??? ?????? ??? ?? ?????.

C DestructorsCanleadToSeVeralCommonerrors.toaVoidthem : 1) ?? ?? ?? ?? ?? ?? ???

C? ???? ??? ??? ? ??? ?? ????? ????. 1. ??? ???? ?? ??? ?? ????? ???? ??? ??? ???? ?? ? ? ????. 2. ??? ?? ???? ?? ??? ? ???? ?? ????, ??? ???? ?????.

?? ???? ??? C?? ??? ??? ???? ??? : ? ????? ? ? ????? C? ??? ? ????? ?? ?? ??? ?? ??? ???? ?????. 1. ?? ??? ???? C? ?? ??? ???? ?? ?? ?? Curly Braces {}? ???? ?? ??? ?? ??? ???????. 2. ?? ??? ? ??? ?? ???? C?? ?? ??? ?? ????? ??? ???? ???? ???? ??? ?????? ???????. RAII ??? ?? ??? ??? ? ????. 3. ?? ? ??? ???? C? ?? ?, ??? ? ???? ?? ??? ??????? ??? ???? ?? ?? ??? ???????. 4. ?? ????? ???? STL? ??? ????? ????? ????? ???? ????? ????? ???????. 5

C polymorphismincludescompile time, ??? ? Templatepolymorphism.1) compile-timepolymorphismusesfunctionandoveroveroverforlogy

C polymorphismisuniqueduetoitscompikeofile-timeandruntimepolymorphism, forbothefficiency andfoxible.toharnesspowertylogly : 1) audesMartPointerSlikestd :: Quanior_PtrformemoryManagement, 2) ?? baseclasseshavevirtuctors, 3) ??
