Skip to content

Instantly share code, notes, and snippets.

@CaCTuCaTu4ECKuu
CaCTuCaTu4ECKuu / ConfirmationKeyProvider.cs
Last active July 25, 2023 15:04
YC cb to queue function
namespace Function
{
public class ConfirmationKeyProvider
{
private readonly Dictionary<long, string> GroupKeys;
public ConfirmationKeyProvider()
{
GroupKeys = new Dictionary<long, string>()
{
@CaCTuCaTu4ECKuu
CaCTuCaTu4ECKuu / StringEnum.cs
Created October 5, 2020 03:19
Static properties initialization does not work when inheriting
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
namespace TypeSafeEnum
{
[DebuggerDisplay("{Name}")]
public abstract class StringEnum<T> where T : StringEnum<T>, IEquatable<T>
Microsoft Visual Studio Community 2019
Версия 16.5.1
VisualStudio.16.Release/16.5.1+29920.165
Microsoft .NET Framework
Версия 4.8.03752
Установленная версия: Community
ADL Tools Service Provider 1.0
This package contains services used by Data Lake tools
using System;
using System.Diagnostics;
using System.Linq;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
namespace Vkm.Core.Events
{
public virtual async Task UpdateAsync(T entity)
{
if (entity == null)
throw new ArgumentNullException(nameof(entity));
if (!IsAttached(entity, out EntityEntry<T> entry))
{
Entities.Attach(entity);
_dbContext.Entry(entity).State = EntityState.Modified;
}