uz
Feedback
Coder Baba

Coder Baba

Kanalga Telegramโ€™da oโ€˜tish

Everything about programming for beginners. 1 and only official telegram channel of CODERBABA India. Content: .NET Developer, Programming (ASP. NET, VB. NET, C#, SQL Server), & Projects follow me https://linktr.ee/coderbaba *Programming *Coding *Note

Ko'proq ko'rsatish
2 319
Obunachilar
-124 soatlar
-167 kunlar
-2830 kunlar
Postlar arxiv
โœ”๏ธ ๐—ฅ๐—ฒ๐—ฝ๐—น๐—ฎ๐—ฐ๐—ฒ ๐—ถ๐—ณ ๐˜€๐˜๐—ฎ๐˜๐—ฒ๐—บ๐—ฒ๐—ป๐˜ ๐˜„๐—ถ๐˜๐—ต ๐—ก๐˜‚๐—น๐—น ๐—–๐—ผ๐—ป๐—ฑ๐—ถ๐˜๐—ถ๐—ผ๐—ป๐—ฎ๐—น ๐—ข๐—ฝ๐—ฒ๐—ฟ๐—ฎ๐˜๐—ผ๐—ฟ
โœ”๏ธ ๐—ฅ๐—ฒ๐—ฝ๐—น๐—ฎ๐—ฐ๐—ฒ ๐—ถ๐—ณ ๐˜€๐˜๐—ฎ๐˜๐—ฒ๐—บ๐—ฒ๐—ป๐˜ ๐˜„๐—ถ๐˜๐—ต ๐—ก๐˜‚๐—น๐—น ๐—–๐—ผ๐—ป๐—ฑ๐—ถ๐˜๐—ถ๐—ผ๐—ป๐—ฎ๐—น ๐—ข๐—ฝ๐—ฒ๐—ฟ๐—ฎ๐˜๐—ผ๐—ฟ

โœ”๏ธ ๐—จ๐˜€๐—ฒ ๐˜€๐˜๐—ฟ๐—ถ๐—ป๐—ด.๐—˜๐—พ๐˜‚๐—ฎ๐—น๐˜€ ๐—ถ๐—ป๐˜€๐˜๐—ฒ๐—ฎ๐—ฑ ๐—ผ๐—ณ ๐—ง๐—ผ๐—จ๐—ฝ๐—ฝ๐—ฒ๐—ฟ()/๐—ง๐—ผ๐—Ÿ๐—ผ๐˜„๐—ฒ๐—ฟ() ๐˜„๐—ต๐—ฒ๐—ป ๐—ฐ๐—ผ๐—บ๐—ฝ๐—ฎ๐—ฟ๐—ถ๐—ป๐—ด ๐˜€๐˜๐—ฟ๏ฟฝ
โœ”๏ธ ๐—จ๐˜€๐—ฒ ๐˜€๐˜๐—ฟ๐—ถ๐—ป๐—ด.๐—˜๐—พ๐˜‚๐—ฎ๐—น๐˜€ ๐—ถ๐—ป๐˜€๐˜๐—ฒ๐—ฎ๐—ฑ ๐—ผ๐—ณ ๐—ง๐—ผ๐—จ๐—ฝ๐—ฝ๐—ฒ๐—ฟ()/๐—ง๐—ผ๐—Ÿ๐—ผ๐˜„๐—ฒ๐—ฟ() ๐˜„๐—ต๐—ฒ๐—ป ๐—ฐ๐—ผ๐—บ๐—ฝ๐—ฎ๐—ฟ๐—ถ๐—ป๐—ด ๐˜€๐˜๐—ฟ๐—ถ๐—ป๐—ด๐˜€ ๐ŸŒ Using ๐—ง๐—ผ๐—จ๐—ฝ๐—ฝ๐—ฒ๐—ฟ() and ๐—ง๐—ผ๐—Ÿ๐—ผ๐˜„๐—ฒ๐—ฟ() for case conversion in C# can impact performance due to memory allocation, string copying, and potential garbage collection, especially in situations involving large strings or frequent conversions. ๐Ÿš€ ๐—ฆ๐˜๐—ฟ๐—ถ๐—ป๐—ด.๐—˜๐—พ๐˜‚๐—ฎ๐—น๐˜€ is faster than ToUpper() or ToLower() due to direct character comparison, avoiding memory allocation, and reducing overhead for case-insensitive string comparison. ๐Ÿ”ฅ To perform string comparison , it's better to use the built-in comparison methods like ๐—ฆ๐˜๐—ฟ๐—ถ๐—ป๐—ด.๐—˜๐—พ๐˜‚๐—ฎ๐—น๐˜€ with appropriate StringComparison options, which handle case-insensitivity and cultural considerations correctly while maintaining better performance and accuracy.

โœ”๏ธ ๐——๐—ฒ๐—ฐ๐—น๐—ฎ๐—ฟ๐—ฎ๐˜๐—ถ๐—ผ๐—ป ๐—ฃ๐—ฎ๐˜๐˜๐—ฒ๐—ฟ๐—ป โœ… You use declaration and type patterns to check if the run-time type of an expressi
โœ”๏ธ ๐——๐—ฒ๐—ฐ๐—น๐—ฎ๐—ฟ๐—ฎ๐˜๐—ถ๐—ผ๐—ป ๐—ฃ๐—ฎ๐˜๐˜๐—ฒ๐—ฟ๐—ป โœ… You use declaration and type patterns to check if the run-time type of an expression is compatible with a given type. With a ๐—ฑ๐—ฒ๐—ฐ๐—น๐—ฎ๐—ฟ๐—ฎ๐˜๐—ถ๐—ผ๐—ป ๐—ฝ๐—ฎ๐˜๐˜๐—ฒ๐—ฟ๐—ป, you can also declare a new local variable. When a declaration pattern matches an expression, that variable is assigned a converted expression result. ๐Ÿ”ฅ ๐—”๐—ฑ๐˜ƒ๐—ฎ๐—ป๐˜๐—ฎ๐—ด๐—ฒ๐˜€ ๐—ผ๐—ณ ๐˜‚๐˜€๐—ถ๐—ป๐—ด ๐—ฑ๐—ฒ๐—ฐ๐—น๐—ฎ๐—ฟ๐—ฎ๐˜๐—ถ๐—ผ๐—ป ๐—ฝ๐—ฎ๐˜๐˜๐—ฒ๐—ฟ๐—ป๐˜€: โ—พ๏ธ They can make your code more readable and maintainable. โ—พ๏ธ They can help you to avoid errors caused by type mismatches. โ—พ๏ธ They can be used to write more concise and expressive code. ๐—ง๐—ต๐—ฎ๐—ป๐—ธ ๐˜†๐—ผ๐˜‚ ๐—ณ๐—ผ๐—ฟ ๐—ฟ๐—ฒ๐—ฎ๐—ฑ๐—ถ๐—ป๐—ด ๐Ÿ“–

๐Ÿ’ก๐—–# ๐—ง๐—ถ๐—ฝ โœ”๏ธ๐—จ๐˜€๐—ฒ ๐—ป๐—ฎ๐—บ๐—ฒ๐—ผ๐—ณ() ๐˜๐—ผ ๐—ฐ๐—ผ๐—ป๐˜ƒ๐—ฒ๐—ฟ๐˜ ๐—ฎ๐—ป ๐—ฒ๐—ป๐˜‚๐—บ ๐˜๐—ผ ๐—ฎ ๐˜€๐˜๐—ฟ๐—ถ๐—ป๐—ด โœ… The ๐—ง๐—ผ๐—ฆ๐˜๐—ฟ๐—ถ๐—ป๐—ด method, inherited from the System.Object class, is used to convert a value into its string representation. It can be overridden in derived classes to provide a meaningful string representation of the object's current state. โœ… The ๐—ป๐—ฎ๐—บ๐—ฒ๐—ผ๐—ณ keyword, introduced in C# 6.0, is used to get the name of a variable, type, or member as a string at compile-time. It's useful to avoid magic strings in your code and to keep your code refactor-friendly. ๐Ÿš€ ๐—ป๐—ฎ๐—บ๐—ฒ๐—ผ๐—ณ() is the preferred way to convert an enum to a string. This is because nameof() is evaluated at compile time and will inject a string literal that will never change, while ToString() is evaluated at runtime. This means that nameof() is more efficient and can help to improve the performance of your code. ๐Ÿ’ก Using nameof() with enums can lead to mismatched enum member names if the enum changes without recompiling referencing projects, as nameof() provides names at compile-time. ๐—ง๐—ต๐—ฎ๐—ป๐—ธ ๐˜†๐—ผ๐˜‚ ๐—ณ๐—ผ๐—ฟ ๐—ฟ๐—ฒ๐—ฎ๐—ฑ๐—ถ๐—ป๐—ด ๐Ÿ“–

โœ”๏ธ๐—จ๐˜€๐—ฒ ๐—ป๐—ฎ๐—บ๐—ฒ๐—ผ๐—ณ() ๐˜๐—ผ ๐—ฐ๐—ผ๐—ป๐˜ƒ๐—ฒ๐—ฟ๐˜ ๐—ฎ๐—ป ๐—ฒ๐—ป๐˜‚๐—บ ๐˜๐—ผ ๐—ฎ ๐˜€๐˜๐—ฟ๐—ถ๐—ป๐—ด
โœ”๏ธ๐—จ๐˜€๐—ฒ ๐—ป๐—ฎ๐—บ๐—ฒ๐—ผ๐—ณ() ๐˜๐—ผ ๐—ฐ๐—ผ๐—ป๐˜ƒ๐—ฒ๐—ฟ๐˜ ๐—ฎ๐—ป ๐—ฒ๐—ป๐˜‚๐—บ ๐˜๐—ผ ๐—ฎ ๐˜€๐˜๐—ฟ๐—ถ๐—ป๐—ด

๐Ÿ’ก๐—–# ๐—ง๐—ถ๐—ฝ โœ”๏ธ๐—จ๐˜€๐—ฒ ๐˜†๐—ถ๐—ฒ๐—น๐—ฑ ๐—ฟ๐—ฒ๐˜๐˜‚๐—ฟ๐—ป ๐˜๐—ผ ๐—บ๐—ถ๐—ป๐—ถ๐—บ๐—ถ๐˜‡๐—ฒ ๐—บ๐—ฒ๐—บ๐—ผ๐—ฟ๐˜† ๐˜‚๐˜€๐—ฎ๐—ด๐—ฒ โœ… The ๐˜†๐—ถ๐—ฒ๐—น๐—ฑ keyword is used in an iterator block to provide a value to the enumerator object or to signal the end of iteration. When used with return, it provides a value, and when used with break, it signals the end of iteration. โœ… The ๐˜†๐—ถ๐—ฒ๐—น๐—ฑ keyword is often used for custom iteration over a collection. It's a powerful tool for writing more efficient code. It's worth noting that yield can only be used in the body of methods, operators, or accessors, and those have to return either IEnumerable, IEnumerable, IEnumerator, or IEnumerator. ๐Ÿ”ฅ ๐—”๐—ฑ๐˜ƒ๐—ฎ๐—ป๐˜๐—ฎ๐—ด๐—ฒ๐˜€ ๐—ผ๐—ณ ๐˜‚๐˜€๐—ถ๐—ป๐—ด ๐˜†๐—ถ๐—ฒ๐—น๐—ฑ: โ—พ๏ธ๐——๐—ฒ๐—ณ๐—ฒ๐—ฟ๐—ฟ๐—ฒ๐—ฑ ๐—ฒ๐˜…๐—ฒ๐—ฐ๐˜‚๐˜๐—ถ๐—ผ๐—ป: The code in an iterator block (where yield return is used) is not executed until the sequence is enumerated. This can lead to performance benefits because it allows elements to be generated on demand rather than all at once. โ—พ๏ธ๐—ฆ๐—ถ๐—บ๐—ฝ๐—น๐—ฒ๐—ฟ ๐—ฐ๐—ผ๐—ฑ๐—ฒ: When creating a collection that needs to be iterated over, yield can simplify your code by abstracting away the need to create and manage your own collection. โ—พ๏ธ๐— ๐—ฒ๐—บ๐—ผ๐—ฟ๐˜† ๐—˜๐—ณ๐—ณ๐—ถ๐—ฐ๐—ถ๐—ฒ๐—ป๐—ฐ๐˜†: When iterating over large collections or sequences, yield can be more memory efficient because it does not require the entire collection to be held in memory at once. ๐—ง๐—ต๐—ฎ๐—ป๐—ธ ๐˜†๐—ผ๐˜‚ ๐—ณ๐—ผ๐—ฟ ๐—ฟ๐—ฒ๐—ฎ๐—ฑ๐—ถ๐—ป๐—ด ๐Ÿ“–

โœ”๏ธ๐—จ๐˜€๐—ฒ ๐˜†๐—ถ๐—ฒ๐—น๐—ฑ ๐—ฟ๐—ฒ๐˜๐˜‚๐—ฟ๐—ป ๐˜๐—ผ ๐—บ๐—ถ๐—ป๐—ถ๐—บ๐—ถ๐˜‡๐—ฒ ๐—บ๐—ฒ๐—บ๐—ผ๐—ฟ๐˜† ๐˜‚๐˜€๐—ฎ๐—ด๐—ฒ
โœ”๏ธ๐—จ๐˜€๐—ฒ ๐˜†๐—ถ๐—ฒ๐—น๐—ฑ ๐—ฟ๐—ฒ๐˜๐˜‚๐—ฟ๐—ป ๐˜๐—ผ ๐—บ๐—ถ๐—ป๐—ถ๐—บ๐—ถ๐˜‡๐—ฒ ๐—บ๐—ฒ๐—บ๐—ผ๐—ฟ๐˜† ๐˜‚๐˜€๐—ฎ๐—ด๐—ฒ

โœ”๏ธ ๐—ฃ๐—ฎ๐—ฟ๐—ฎ๐—น๐—น๐—ฒ๐—น ๐—™๐—ผ๐—ฟ๐—˜๐—ฎ๐—ฐ๐—ต ๐ŸŒ The regular ๐—ณ๐—ผ๐—ฟ๐—ฒ๐—ฎ๐—ฐ๐—ต loop is a sequential construct. It iterates over a collection or an enumerable in a single-threaded manner, processing each element one after the other. It's a good choice when the tasks performed inside the loop are relatively simple and quick to execute, and there's no need to parallelize them. ๐Ÿš€ The ๐—ฃ๐—ฎ๐—ฟ๐—ฎ๐—น๐—น๐—ฒ๐—น.๐—™๐—ผ๐—ฟ๐—˜๐—ฎ๐—ฐ๐—ต construct is part of the System.Threading.Tasks namespace and is designed for parallel execution of tasks across multiple threads. It divides the input collection into smaller partitions and processes them concurrently on separate threads. โœ… The performance of ๐—ณ๐—ผ๐—ฟ๐—ฒ๐—ฎ๐—ฐ๐—ต and ๐—ฃ๐—ฎ๐—ฟ๐—ฎ๐—น๐—น๐—ฒ๐—น.๐—™๐—ผ๐—ฟ๐—˜๐—ฎ๐—ฐ๐—ต depends on the specific scenario. In general, Parallel.ForEach can be faster than foreach if the collection is large and the work being done is well-suited for parallel execution. However, there are some cases where foreach may be faster than Parallel.ForEach. ๐—ง๐—ต๐—ฎ๐—ป๐—ธ ๐˜†๐—ผ๐˜‚ ๐—ณ๐—ผ๐—ฟ ๐—ฟ๐—ฒ๐—ฎ๐—ฑ๐—ถ๐—ป๐—ด ๐Ÿ“–

๐Ÿ’ก๐—–# ๐—ง๐—ถ๐—ฝ โœ”๏ธ ๐—ฃ๐—ฎ๐—ฟ๐—ฎ๐—น๐—น๐—ฒ๐—น ๐—™๐—ผ๐—ฟ๐—˜๐—ฎ๐—ฐ๐—ต
๐Ÿ’ก๐—–# ๐—ง๐—ถ๐—ฝ โœ”๏ธ ๐—ฃ๐—ฎ๐—ฟ๐—ฎ๐—น๐—น๐—ฒ๐—น ๐—™๐—ผ๐—ฟ๐—˜๐—ฎ๐—ฐ๐—ต

โœ”๏ธ๐—ฃ๐—ฟ๐—ผ๐—ฝ๐—ฒ๐—ฟ๐˜๐˜† ๐—ฃ๐—ฎ๐˜๐˜๐—ฒ๐—ฟ๐—ป ๐— ๐—ฎ๐˜๐—ฐ๐—ต๐—ถ๐—ป๐—ด in C# โœ… It is allows you to test whether an expression's properties or fie
โœ”๏ธ๐—ฃ๐—ฟ๐—ผ๐—ฝ๐—ฒ๐—ฟ๐˜๐˜† ๐—ฃ๐—ฎ๐˜๐˜๐—ฒ๐—ฟ๐—ป ๐— ๐—ฎ๐˜๐—ฐ๐—ต๐—ถ๐—ป๐—ด in C# โœ… It is allows you to test whether an expression's properties or fields match specific values or nested patterns. It's a concise and expressive way to perform conditional logic based on object structures. ๐Ÿ”ฅ ๐—”๐—ฑ๐˜ƒ๐—ฎ๐—ป๐˜๐—ฎ๐—ด๐—ฒ๐˜€: โ—พ๏ธ ๐—–๐—ผ๐—ป๐—ฐ๐—ถ๐˜€๐—ฒ๐—ป๐—ฒ๐˜€๐˜€: Can be used to create more concise and readable code. โ—พ๏ธ ๐—˜๐˜…๐—ฝ๐—ฟ๐—ฒ๐˜€๐˜€๐—ถ๐˜ƒ๐—ฒ๐—ป๐—ฒ๐˜€๐˜€: Can be used to express more complex conditions. โ—พ๏ธ ๐—ง๐˜†๐—ฝ๐—ฒ ๐˜€๐—ฎ๐—ณ๐—ฒ๐˜๐˜†: Ensures type correctness at compile time, reducing potential runtime errors. ๐Ÿค” Which one do you prefer? ๐—ง๐—ต๐—ฎ๐—ป๐—ธ ๐˜†๐—ผ๐˜‚ ๐—ณ๐—ผ๐—ฟ ๐—ฟ๐—ฒ๐—ฎ๐—ฑ๐—ถ๐—ป๐—ด ๐Ÿ“–

โœ”๏ธ ๐—ก๐˜‚๐—น๐—น ๐—ฎ๐—ฟ๐—ด๐˜‚๐—บ๐—ฒ๐—ป๐˜ ๐—ฐ๐—ต๐—ฒ๐—ฐ๐—ธ๐˜€ ๐—ถ๐—ป ๐—–# ๐Ÿญ๐Ÿฌ ๐—ฎ๐—ป๐—ฑ .๐—ก๐—˜๐—ง ๐Ÿฒ โœ… The ๐—”๐—ฟ๐—ด๐˜‚๐—บ๐—ฒ๐—ป๐˜๐—ก๐˜‚๐—น๐—น๐—˜๐˜…๐—ฐ๐—ฒ๐—ฝ๐˜๐—ถ๐—ผ๐—ป.๐—ง
โœ”๏ธ ๐—ก๐˜‚๐—น๐—น ๐—ฎ๐—ฟ๐—ด๐˜‚๐—บ๐—ฒ๐—ป๐˜ ๐—ฐ๐—ต๐—ฒ๐—ฐ๐—ธ๐˜€ ๐—ถ๐—ป ๐—–# ๐Ÿญ๐Ÿฌ ๐—ฎ๐—ป๐—ฑ .๐—ก๐—˜๐—ง ๐Ÿฒ โœ… The ๐—”๐—ฟ๐—ด๐˜‚๐—บ๐—ฒ๐—ป๐˜๐—ก๐˜‚๐—น๐—น๐—˜๐˜…๐—ฐ๐—ฒ๐—ฝ๐˜๐—ถ๐—ผ๐—ป.๐—ง๐—ต๐—ฟ๐—ผ๐˜„๐—œ๐—ณ๐—ก๐˜‚๐—น๐—น method is a static method in the System namespace that throws an ๐—”๐—ฟ๐—ด๐˜‚๐—บ๐—ฒ๐—ป๐˜๐—ก๐˜‚๐—น๐—น๐—˜๐˜…๐—ฐ๐—ฒ๐—ฝ๐˜๐—ถ๐—ผ๐—ป if the specified object is null. It is a convenient way to check for null parameters in your code. It can help to prevent runtime errors and make the code more concise. ๐Ÿ”ฅ ๐—”๐—ฑ๐˜ƒ๐—ฎ๐—ป๐˜๐—ฎ๐—ด๐—ฒ๐˜€ ๐—ผ๐—ณ ๐—”๐—ฟ๐—ด๐˜‚๐—บ๐—ฒ๐—ป๐˜๐—ก๐˜‚๐—น๐—น๐—˜๐˜…๐—ฐ๐—ฒ๐—ฝ๐˜๐—ถ๐—ผ๐—ป.๐—ง๐—ต๐—ฟ๐—ผ๐˜„๐—œ๐—ณ๐—ก๐˜‚๐—น๐—น: โ—พ๏ธ It is easy to use. Just pass the object you want to check for null to the method, and it will throw an exception if the object is null. โ—พ๏ธ It is reduce code size and make it easy to read. ๐Ÿค” Which one do you prefer? ๐—ง๐—ต๐—ฎ๐—ป๐—ธ ๐˜†๐—ผ๐˜‚ ๐—ณ๐—ผ๐—ฟ ๐—ฟ๐—ฒ๐—ฎ๐—ฑ๐—ถ๐—ป๐—ด ๐Ÿ“–

๐Ÿ’ก The ๐˜€๐˜„๐—ถ๐˜๐—ฐ๐—ต ๐—ฒ๐˜…๐—ฝ๐—ฟ๐—ฒ๐˜€๐˜€๐—ถ๐—ผ๐—ป was introduced in C# 8 as a more concise and expressive alternative to the traditional switch statement. It allows you to assign a value to a variable based on the value of an expression. In a switch expression, you use the => syntax to specify the value to assign if the expression matches a certain case. The _ is a discard symbol and is used as the "default" case. โœ… Both the ๐˜€๐˜„๐—ถ๐˜๐—ฐ๐—ต ๐˜€๐˜๐—ฎ๐˜๐—ฒ๐—บ๐—ฒ๐—ป๐˜ and the ๐˜€๐˜„๐—ถ๐˜๐—ฐ๐—ต ๐—ฒ๐˜…๐—ฝ๐—ฟ๐—ฒ๐˜€๐˜€๐—ถ๐—ผ๐—ป are used for similar purposes, the switch expression offers more concise syntax and greater flexibility for pattern matching and value assignment, making it a more powerful tool for modern C# development. ๐Ÿค” Which one do you prefer? ๐—ง๐—ต๐—ฎ๐—ป๐—ธ ๐˜†๐—ผ๐˜‚ ๐—ณ๐—ผ๐—ฟ ๐—ฟ๐—ฒ๐—ฎ๐—ฑ๐—ถ๐—ป๐—ด ๐Ÿ“–

โœ”๏ธ๐—ฆ๐˜„๐—ถ๐˜๐—ฐ๐—ต ๐—˜๐˜…๐—ฝ๐—ฟ๐—ฒ๐˜€๐˜€๐—ถ๐—ผ๐—ป in C# ๐Ÿ•ฏ The ๐˜€๐˜„๐—ถ๐˜๐—ฐ๐—ต ๐˜€๐˜๐—ฎ๐˜๐—ฒ๐—บ๐—ฒ๐—ป๐˜ has been part of C# since its early versions
โœ”๏ธ๐—ฆ๐˜„๐—ถ๐˜๐—ฐ๐—ต ๐—˜๐˜…๐—ฝ๐—ฟ๐—ฒ๐˜€๐˜€๐—ถ๐—ผ๐—ป in C# ๐Ÿ•ฏ The ๐˜€๐˜„๐—ถ๐˜๐—ฐ๐—ต ๐˜€๐˜๐—ฎ๐˜๐—ฒ๐—บ๐—ฒ๐—ป๐˜ has been part of C# since its early versions. It allows you to evaluate an expression against a series of case values and execute code blocks based on the matched case. Each case value must be a constant value that is known at compile-time. After a case block is executed, you usually need to include a break statement to exit the switch statement.

๐Ÿ’ก๐—–# ๐—ง๐—ถ๐—ฝ โœ”๏ธ ๐—จ๐˜€๐—ฒ ๐—ฟ๐—ฒ๐—ฐ๐—ผ๐—ฟ๐—ฑ๐˜€ ๐—ณ๐—ผ๐—ฟ ๐——๐—ง๐—ข๐˜€ โœ… ๐—ฅ๐—ฒ๐—ฐ๐—ผ๐—ฟ๐—ฑ๐˜€ are a feature introduced in ๐—–# ๐Ÿต.๐Ÿฌ that allows you
๐Ÿ’ก๐—–# ๐—ง๐—ถ๐—ฝ โœ”๏ธ ๐—จ๐˜€๐—ฒ ๐—ฟ๐—ฒ๐—ฐ๐—ผ๐—ฟ๐—ฑ๐˜€ ๐—ณ๐—ผ๐—ฟ ๐——๐—ง๐—ข๐˜€ โœ… ๐—ฅ๐—ฒ๐—ฐ๐—ผ๐—ฟ๐—ฑ๐˜€ are a feature introduced in ๐—–# ๐Ÿต.๐Ÿฌ that allows you to create simple, immutable data types. They are particularly useful for representing ๐——๐—ง๐—ข๐˜€ (Data Transfer Objects) because they provide a concise syntax for defining classes that are primarily used to transfer data between layers of an application, such as between the business logic layer and the presentation layer. โœ… ๐—ฅ๐—ฒ๐—ฐ๐—ผ๐—ฟ๐—ฑ๐˜€ are best suited for simple data structures, and they are not meant to replace classes for all scenarios. For more complex types with behavior, you may still want to use regular classes or other features provided by C#. ๐Ÿ”ฅ ๐—ฅ๐—ฒ๐—ฐ๐—ผ๐—ฟ๐—ฑ๐˜€ are an excellent choice for creating ๐——๐—ง๐—ข๐˜€ due to their simplicity, immutability, and concise syntax, which helps in writing clean and maintainable code. ๐—ง๐—ต๐—ฎ๐—ป๐—ธ ๐˜†๐—ผ๐˜‚ ๐—ณ๐—ผ๐—ฟ ๐—ฟ๐—ฒ๐—ฎ๐—ฑ๐—ถ๐—ป๐—ด ๐Ÿ“–

full stack aspdotnet Roadmap.pptx0.77 KB

photo content

+1
Online Shoe Shopping aspdotnet Website Project(Coderbaba).rar10.48 MB

Connect to the Computer World.pdf4.73 KB

AutoGenerate ID in aspdotnet C# โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€” private void AutoGenerateID() { SqlConnection con=new SqlConnection(""); string qr="select 'EMP' + cast(max(cast(SUBSTRING(employeeid,4,5)as int))+1 as nvarchar)as nextkey from tblemployee"; SqlCommand cmd=new SqlCommand("qr",con); if(con.State==ConnectionState.Closed) { con.Open(); } SqlDataReader dr=new cmd.ExecuteReader(); while(dr.read()) { if(dr[0].ToString()!="" || dr[0].ToString().trim()!=string.empty) { string id=dr[0].ToString(); textempid.text=id; } else { textempid.text="EMP1"; } } if(dr.HasRows) { dr.Close(); } } ________________________________________________