Snipps
Filter by Set
...see more

EF Core Migrations is a feature that helps manage database schema changes. It allows developers to easily create, update, and rollback database migrations using a code-first approach, ensuring that your database schema stays in sync with your application models.

...see more

This set outlines how to construct a filter for the User Object Filter and Group Object Filter attributes in an LDAP configuration.

...see more
(&(objectClass=user)(cn=Mark*))

This means: search for all entries that have objectClass=user AND cn that start with the word 'Mark'.

...see more

A C# method can be called with invalid arguments, this may cause an ArgumentException.

ArgumentException indicates that a method was called with an invalid argument. This can help improve program quality.

...see more

ArgumentException is thrown when a method is invoked and at least one of the passed arguments does not meet the parameter specification of the called method. The ParamName property identifies the invalid argument.

When using the ArgumentNullException constructor, you can pass a string literal indicating the null argument.

...see more

The time service in Windows can be reset to a default state by running the following inside an elevated Command Prompt (CMD):

net stop w32time
w32tm /unregister
w32tm /register
net start w32time

To verify the time server, follow these steps:

  • Run timedate.cpl
  • Position to the "Internet Time" tab
  • Click "Change settings…" and verify the time server (like time.windows.com)
  • Ensure that "Synchronize with an Internet time server" is checked
  • Click on "Update Now" and click OK to save the changes.
...see more

Scrum is an empirical process control framework.

Empirical means to runs experiments to improve the product.

...see more

Meetings in Scrum

  • Sprint Planning
  • Sprint Daily Sync
  • Sprint Review
  • Sprint Retrospective

Additional meetings

  • Sprint Review Preparation
  • Sprint Review Demo Preparation
  • Sprint Review Dry Run
...see more

You can use the following code snippets to get a class's public methods using reflection. The class name is provided as typeName.

MethodInfo[] methodInfos = typeof(Class).GetMethods();

Variant with filter using BindingFlags

MethodInfo[] methodInfos = Type.GetType(typeName) 
                           .GetMethods(BindingFlags.Public | BindingFlags.Instance);
...see more

You can use this code to get only the methods decorated with a custom attribute.

MethodInfo[] methodInfos = assembly.GetTypes()
                      .SelectMany(t => t.GetMethods())
                      .Where(m => m.GetCustomAttributes(typeof(CustomAttribute), false).Length > 0)
                      .ToArray();
...see more

Here’s an example of how to invoke a private method using reflection in .NET:

MyClass myClass = new MyClass();
Type classType = myClass.GetType();
MethodInfo methodInfo = classType.GetMethod("MethodName",
                BindingFlags.Instance | BindingFlags.NonPublic);
 
// Make an invocation:
var result = await (dynamic)methodInfo.Invoke(myClass, null);
...see more

Sometimes, we want to change an HTML5 input’s placeholder color with CSS.

To change an HTML5 input’s placeholder color with CSS, we use the ::placeholder selector.

For instance, to set the input placeholder’s color to #909 we write:

::placeholder {
  color: #909;
}
...see more

Updating data using EF Core is straightforward. Retrieve the entity, modify its properties, and call `SaveChanges()`. EF Core automatically generates the appropriate SQL statements to update the corresponding record in the database, making data updates a breeze.

...see more

HTTP response status codes indicate whether a specific HTTP request has been successfully completed.

...see more

The HTTP PUT request method creates a new resource or replaces a representation of the target resource with the request payload.

The difference between PUT and POST is that PUT is idempotent: calling it once or several times successively has the same effect (that is, no side effect), whereas successive identical POST requests may have additional effects, akin to placing an order several times.

...see more

It is possible to use PUT without a body like

PUT /example HTTP/1.0
Content-Type: text/plain
Content-Length: 0

A sample would be the github starring API, which uses PUT with an empty body to turn on a star and DELETE to turn off a star.

...see more

You can get private property like so:

Class class = new Class();
var privateProperty = class.GetType().GetProperty("privateProperty", BindingFlags.Instance | BindingFlags.NonPublic);
int propertyValue = (int) privateProperty.GetValue(class);

var privateField = class.GetType().GetField("privateField", BindingFlags.Instance | BindingFlags.NonPublic);
int fieldValue = (int) privateField.GetValue(class);
...see more

Entity Framework Core 5 is the first EF version to support filtering in Include.

Supported operations are Where, OrderBy(Descending)/ThenBy(Descending), Skip, Take

Some usage example

context.Customers
    .Include(c => c.Orders.Where(o => o.Name != "Foo")).ThenInclude(o => o.OrderDetails)
    .Include(c => c.Orders).ThenInclude(o => o.Customer)

Only one filter is allowed per navigation, so for cases where the same navigation needs to be included multiple times (e.g. multiple ThenInclude on the same navigation) apply the filter only once, or apply exactly the same filter for that navigation.

...see more

In the example below, we have a list of numbers. The ForEach method is called on the list and a lambda expression num => Console.WriteLine(num) is passed as the argument. This lambda expression takes each element num from the list and prints it using Console.WriteLine. The lambda acts as the action to be performed on each element in the list.

var numbers = new List<int> { 1, 2, 3, 4, 5 };
numbers.ForEach(num => Console.WriteLine(num));
...see more

The spread (...) syntax allows an iterable, such as an array or string, to be expanded in places where zero or more arguments (for function calls) or elements (for array literals) are expected.

Spread operator doing concat

let arrayOne = [1, 2, 3];
let arraryTwo = [4, 5];
arrayCombined = [...arrayOne,...arrayTwo];

Add item using spread operator

let arrayOne = [1, 2, 3];
arrayNew = [...arrayOne, 3];

Spread syntax (...) - JavaScript | MDN (mozilla.org)

...see more

This is an elementary guide to Git for beginners. Git is a version-control system for tracking changes in files associated with projects of different types. It is primarily used for source-code management in software development, but it can be used to keep track of changes in any set of files.

Without a version control system, you probably used to frequently save copies of your work-in-progress in zip files. But when you feel that your work is a mess and you need to get back to a previous version of some files, how to deal with mixed changes in files? It’s a real pain to do that. Git and other version control systems like SVN are a great solution.

...see more

Eine zukunftssichere und nachhaltige Investition ist heute nur noch mit natürlichen Kältemitteln, die bereits seit mehr als hundert Jahren erfolgreich eingesetzt werden, möglich.

Systeme mit natürlichen Stoffen mit niedrigem Treibhauspotential, wie Kohlenwasserstoffe, Kohlendioxid oder Ammoniak, können sowohl die Einträge von TFA deutlich verringert als auch das ⁠Klima⁠ geschützt werden.

Auf europäischer Ebene gibt es Bestrebungen HFO-Kältemittel aufgrund ihrer starken Umweltschädigung schnellstmöglich zu verbieten!

...see more

R 410A gehört zu den synthetischen Kältemitteln, die in Kälte- und Klimaanlagen und Wärmepumpen verwendet werden.

R 410A ist zwar nicht ozonschädlich, jedoch mit einem GWP (Global Warming Potential)-Wert von 2088 ein Treibhausgas.

...see more

Natürliche Kältemittel

Kältemittel   Toxizität Brenbarkeit
R-290 Propan 3 Gering Hoch
R-717 Ammoniak 0 Hoch toxisch Gering
R-1270 Propen 3 Gering Hoch
R-744 CO2 1 Gering Nicht brennbar

 

Synthetische, in der Luft stabile Kältemittel

Kältemittel GWP Toxizität Brenbarkeit
R32 675 Gering Gering
R-407 C 1770 Gering Nicht brennbar
R-410 A/C 2090 Gering Nicht brennbar
R-452 B 698 Gering Gering
R-454 A/C 466 Gering Gering
...see more

Generell wird zwischen natürlichen und synthetischen Kältemitteln unterschieden. Zu den natürlichen Kältemitteln zählt man z. B. Kohlenwasserstoffe, Kohlenstoffdioxid, Ammoniak, Wasser und Luft – also Stoffe, die es so in der Natur gibt. Natürliche Kältemittel haben demnach auch geringe Auswirkungen auf die Umwelt.

Synthetische Kältemittel dagegen werden künstlich hergestellt. Sie werden chemisch auch als halogenierte Kohlenwasserstoffe bezeichnet und eignen sich ebenfalls hervorragend für den Einsatz in Klimaanlagen und Wärmepumpen.

Alle Kältemittel haben ihre Berechtigung, denn jedes Kältemittel hat andere Merkmale und Eigenschaften. Manche eignen sich für den Heizbetrieb besonders gut, andere eignen sich vor allem zum Kühlen. Die Wahl des Kältemittels bestimmt den Energieverbrauch, die Aufstellmöglichkeiten und die Kosten der jeweiligen Anlage.

...see more

Opteon™ XL20 (R-454C) ist ein leicht entflammbares Kältemittel mit einem Erderwärmungspotenzial (GWP) von weniger als 150.

Für viele Haustechnikprodukte wie z.B. lokale Kompakt-Klimageräte gilt bereits ein gesetzlich vorgeschriebener maximaler GWP-Wert von 150 (super low GWP). R454C unterschreitet diesen Grenzwert. Mit einem GWP von 148 hat R454C ein ca. 14-fach geringeres Treibhauspotential als das bisher übliche Kältemittel R410A.

Weitere Informationen

...see more

C# expression operators are fundamental tools for performing computations and evaluating conditions in code.

  • Arithmetic operators (+, -, *, /, %) allow you to perform addition, subtraction, multiplication, division, and modulo operations on numeric values.
  • Comparison operators (==, !=, <, >, <=, >=) are used to compare values and determine relationships, such as equality or order.
  • Logical operators (&&, ||, !) evaluate boolean expressions and help combine conditions to make decisions or control program flow.
  • The conditional operator (?:) allows for concise conditional expressions, making it easier to handle branching logic based on a condition.
  • Assignment operators (=, +=, -=, etc.) assign values to variables or update them by performing an operation.
  • Bitwise operators (&, |, ^, <<, >>) operate on individual bits of numeric values, enabling low-level manipulation and optimization.
  • The null-coalescing operator (??) concisely handles null values, allowing for fallback or default values when encountering null references.

By understanding and utilizing these operators, you gain powerful tools to perform calculations, make decisions, and control the behavior of your C# programs.

...see more

C# Lambda expression operator (=>) is a shorthand syntax for defining anonymous functions. It allows you to write compact and inline functions without the need to declare a separate method. Lambdas are commonly used in LINQ queries, event handlers, and functional programming. They improve code readability, enable concise operations on collections, and provide a flexible way to work with data and delegates.

In lambda expressions, the lambda operator => separates the input parameters on the left side from the lambda body on the right side.

Here's an example that calculates the square of each number in a list:

List<int> numbers = new List<int> { 1, 2, 3, 4, 5 };
List<int> squaredNumbers = numbers.Select(x => x * x).ToList();
// squaredNumbers will be [1, 4, 9, 16, 25]

In this code, we have a list of numbers. Using the Select method and a Lambda expression x => x * x, we square each number in the list. The Lambda expression takes an input x and returns its square x * x. Finally, we have a new list squaredNumbers containing the squared values of the original numbers. Lambda expressions are versatile and enable concise operations on collections, making code more expressive and readable.

...see more

To align content like buttons to the right you can use CSS flexible box layout.

<div class='align-right'>
   <button>Cancel</button>
   <button type='submit'>Create</button>
</div>

The CSS to align the buttons on the right uses two properties.

.align-right {
  display: flex;
  justify-content: flex-end;
}

References

...see more

To do a case-sensitive search in EF Core you can use an explicit collation in a query like

var customers = context.Customers
.Where(c => EF.Functions.Collate(c.Name, "SQL_Latin1_General_CP1_CS_AS") == "John")
.ToList();

Note: EF Core does not support operators on in-memory collections other than simple Contains with primitive values.

References

Resources

...see more

A callback is a function passed as an argument to another function. This technique allows a function to call another function. A callback function can run after another function has finished.

Example

Using a callback, you could call the calculator function (myCalculator) with a callback (myCallback), and let the calculator function run the callback after the calculation is finished:

function myDisplayer(some) {
  document.getElementById("demo").innerHTML = some;
}

function myCalculator(num1, num2, myCallback) {
  let sum = num1 + num2;
  myCallback(sum);
}

myCalculator(5, 5, myDisplayer);

In the example above, myDisplayer is a called a callback function.

It is passed to myCalculator() as an argument.

Note

When you pass a function as an argument, remember not to use parenthesis.

Right: myCalculator(5, 5, myDisplayer);

Wrong: myCalculator(5, 5, myDisplayer());

...see more

Question: How can I check if a string is empty?

Option 1: Check using ""

if (str === "") {
}

Note: to know if it's an empty string use === instead of ==. This is because === will only return true if the values on both sides are of the same type, in this case a string. for example: (false == "") will return true, and (false === "") will return false.

Option 2: Check length of string

if (!str || str.trim().length === 0) {
}
...see more

Question: How do you convert a nullable bool? to a bool in C#?

Solution:

You can use the null-coalescing operator: x ?? something, where something is a boolean value you want to use if x is null.

Example:

bool? nullBool = null;
bool convertedBool = nullBool ?? false; // convertedBool will be false

The null-coalescing operator ?? returns the value of its left-hand operand if it isn't null; otherwise, it evaluates the right-hand operand and returns its result. 

...see more
  • Managed Identities
    • User Assigned Managed Identities (UAMI)
  • Service Principals
  • Service Connections

 

...see more

Azure Key Vault is a cloud-based secrets store for holding app secrets, including configuration values like passwords and connection strings that must always remain secure. It keeps secrets in a single central location and provides secure access, permissions control, and access logging.

Use Azure Key Vault to store secrets like Passwords, Shared Access Signature (SAS) tokens, Application Programming Interface (API) keys, and Personal Access Tokens (PAT).

...see more

The definition of the CSS class

.rotate{
   width:80px;
   height:80px;
   animation: rotation infinite 3s linear;
}

Here we added an animation property with a value rotation infinite 3s linear, which is.

  • rotation: this is the name of the animation.
  • infinite: the animation should play infinitely.
  • 3s: animation duration.
  • linear: play the animation at the same speed from start to end.

Source: How to rotate an image continuously in CSS | Reactgo

Add to Set
  • .NET
  • .NET 6.0 Migration
  • 5 Best websites to read books online free with no downloads
  • 5 surprising things that men find unattractive
  • 5 Ways To Take Control of Overthinking
  • 6 simple methods for a more productive workday
  • 6 Ways To Stop Stressing About Things You Can't Control
  • Add React to ASP.NET Core
  • Adding reCAPTCHA to a .NET Core Web Site
  • Admin Accounts
  • Adobe Acrobat
  • Afraid of the new job? 7 positive tips against negative feelings
  • Agile
  • AKS and Kubernetes Commands (kubectl)
  • API Lifecycle Management
  • Application Insights
  • arc42
  • Article Writing Tools
  • Atlassian
  • Azure API Management
  • Azure App Registration
  • Azure Application Gateway
  • Azure Arc
  • Azure Arc Commands
  • Azure Architectures
  • Azure Bastion
  • Azure Bicep
  • Azure CLI Commands
  • Azure Cloud Products
  • Azure Cognitive Services
  • Azure Container Apps
  • Azure Cosmos DB
  • Azure Cosmos DB Commands
  • Azure Costs
  • Azure Daily
  • Azure Daily 2022
  • Azure Daily 2023
  • Azure Data Factory
  • Azure Database for MySQL
  • Azure Databricks
  • Azure Diagram Samples
  • Azure Durable Functions
  • Azure Firewall
  • Azure Functions
  • Azure Kubernetes Service (AKS)
  • Azure Landing Zone
  • Azure Log Analytics
  • Azure Logic Apps
  • Azure Maps
  • Azure Monitor
  • Azure News
  • Azure PowerShell Cmdlets
  • Azure PowerShell Login
  • Azure Private Link
  • Azure Purview
  • Azure Redis Cache
  • Azure Security Groups
  • Azure Sentinel
  • Azure Service Bus
  • Azure Service Bus Questions (FAQ)
  • Azure Services Abstract
  • Azure SQL
  • Azure Storage Account
  • Azure Tips and Tricks
  • Backlog Items
  • BASH Programming
  • Best LinkedIn Tips (Demo Test)
  • Best Practices for RESTful API
  • Bing Maps
  • Birthday Gift Ideas for Wife
  • Birthday Poems
  • Black Backgrounds and Wallpapers
  • Bootstrap Templates
  • Brave New World
  • Brian Tracy Quotes
  • Build Websites Resources
  • C# Development Issues
  • C# Programming Guide
  • Caching
  • Caching Patterns
  • Camping Trip Checklist
  • Canary Deployment
  • Careers of the Future You Should Know About
  • Cheap Vacation Ideas
  • Cloud Computing
  • Cloud Migration Methods
  • Cloud Native Applications
  • Cloud Service Models
  • Cloudflare
  • Code Snippets
  • Compelling Reasons Why Money Can’t Buy Happiness
  • Conditional Access
  • Configurations for Application Insights
  • Create a Routine
  • Create sitemap.xml in ASP.NET Core
  • Creative Writing: Exercises for creative texts
  • CSS Selectors Cheat Sheet
  • Cultivate a Growth Mindset
  • Cultivate a Growth Mindset by Stealing From Silicon Valley
  • Custom Script Extension for Windows
  • Daily Scrum (Meeting)
  • Dalai Lama Quotes
  • DataGridView
  • Decision Trees
  • Deployments in Azure
  • Dev Box
  • Development Flows
  • Docker
  • Don’t End a Meeting Without Doing These 3 Things
  • Drink More Water: This is How it Works
  • Dropdown Filter
  • Earl Nightingale Quotes
  • Easy Steps Towards Energy Efficiency
  • EF Core
  • Elon Musk
  • Elon Musk Companies
  • Employment
  • English
  • Escape Double Quotes in C#
  • Escaping characters in C#
  • Executing Raw SQL Queries using Entity Framework Core
  • Factors to Consider While Selecting the Best Earthmoving System
  • Feng Shui 101: How to Harmonize Your Home in the New Year
  • Flying Machines
  • Foods against cravings
  • Foods that cool you from the inside
  • Four Misconceptions About Drinking
  • Fox News
  • Free APIs
  • Funny Life Quotes
  • Generate Faces
  • Generate Random Numbers in C#
  • Genius Money Hacks for Massive Savings
  • GitHub
  • GitHub Concepts
  • Green Careers Set to Grow in the Next Decade
  • Habits Of Highly Stressed People and how to avoid them
  • Happy Birthday Wishes & Quotes
  • Helm Overview
  • How to Clean Floors – Tips & Tricks
  • How to invest during the 2021 pandemic
  • How To Make Money From Real Estate
  • How To Stop Drinking Coffee
  • Image for Websites
  • Inspirational Quotes
  • Iqra Technology, IT Services provider Company
  • Jobs Of 2050
  • jQuery
  • jQuery plugins
  • JSON for Linking Data (JSON-LD)
  • Json to C# Converters
  • Karen Lamb Quotes
  • Kubernetes Objects
  • Kubernetes Tools
  • Kusto Query Language
  • Lack of time at work? 5 simple tricks to help you avoid stress
  • Lambda (C#)
  • Last Minute Travel Tips
  • Last-Minute-Reisetipps
  • Latest Robotics
  • Leadership
  • List Of Hobbies And Interests
  • Logitech BRIO Webcam
  • Management
  • Mark Twain Quotes
  • Markdown
  • Meet Sophia
  • Message-Oriented Architecture
  • Microservices
  • Microsoft Authenticator App
  • Microsoft Power Automate
  • Microsoft SQL Server
  • Microsoft Teams
  • Mobile UI Frameworks
  • Motivation
  • Multilingual Applications
  • NBC News
  • NuGet
  • Objectives and Key Results (OKR)
  • Objectives and Key Results (OKR) Samples
  • OKR Software
  • Online JSON Viewer and Parser
  • Outlook Automation
  • PCMag
  • Phases of any relationship
  • Playwright
  • Popular cars per decade
  • Popular Quotes
  • PowerShell
  • PowerShell Array Guide
  • PowerShell Cmdlets
  • PowerShell Coding Samples
  • PowerToys
  • Prism
  • Pros & Cons Of Alternative Energy
  • Quill Rich Text Editor
  • Quotes
  • RACI Matrix
  • Razor Syntax
  • Reasons why singletasking is better than multitasking
  • Regular Expression (RegEx)
  • Resize Images in C#
  • RESTful APIs
  • Rich Text Editors
  • Rob Siltanen Quotes
  • Robots
  • Run sudo commands
  • Salesforce Offshore Support Services Providers
  • Sample Data
  • Save Money On Food
  • Score with authenticity in the job interview
  • Security
  • Semantic Versioning
  • Serialization using Thread Synchronization
  • Service Worker
  • Snipps
  • Speak and Presentation
  • SQL References
  • SQL Server Full-Text Search
  • Successful
  • Surface Lineup 2021
  • Surface Lineup 2021 Videos
  • SVG Online Editors
  • Team Manifesto
  • Technologies
  • Technology Abbreviations
  • Technology Glossary
  • TechSpot
  • That is why you should drink cucumber water every day
  • The Cache Tag Helper in ASP.NET Core
  • The Verge
  • Theodore Roosevelt Quotes
  • These 7 things make you unattractive
  • Things Successful People Do That Others Don’t
  • Things to Consider for a Great Birthday Party
  • Things to Consider When Designing A Website
  • Thoughts
  • TinyMCE Image Options
  • TinyMCE Toolbar Options
  • Tips for a Joyful Life
  • Tips for fewer emails at work
  • Tips for Making Better Decisions
  • Tips for Managing the Stress of Working at Home
  • Tips for Writing that Great Blog Post
  • Tips On Giving Flowers As Gifts
  • Tips you will listen better
  • Top Fitness Tips
  • Top Healthy Tips
  • Top Money Tips
  • Top Ten Jobs
  • Track Authenticated Users in Application Insights
  • Unicode Characters
  • Visual Studio 2022
  • Vital everyday work: tips for healthy work
  • Walking barefoot strengthens your immune system
  • Walt Disney Quotes
  • Ways for Kids to Make Money
  • Web Design Trends & Ideas
  • Web Icons
  • Web Scraping
  • Webhooks
  • Website Feature Development
  • What are my options for investing money?
  • What happens when you drink water in the morning
  • What Is Stressful About Working at Home
  • What To Eat For Lunch
  • Windows 11 Top Features You Should Know
  • Winston Churchill Quotes
  • XPath
  • You'll burn out your team with these 5 leadership mistakes
  • ZDNet
 
Sets