/
dev-npgsql
/
npgsql
Обзор
Документация
Войти
/
dev-npgsql
/
npgsql
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Npgsql/Internal/Postgres/Oid.cs
20 строк
841 B
Shay Rojansky
Apply primary constructors to solution (#5908)
30 окт 2024, 18:30
Не верифицирован
30 окт 2024, 18:30
40cc1a1
Код
Авторство
О чём код?
using System; using System.Diagnostics.CodeAnalysis; namespace Npgsql.Internal.Postgres; [Experimental(NpgsqlDiagnostics.ConvertersExperimental)] public readonly struct Oid(uint value) : IEquatable<Oid> { public static explicit operator uint(Oid oid) => oid.Value; public static implicit operator Oid(uint oid) => new(oid); public uint Value { get; init; } = value; public static Oid Unspecified => new(0); public override string ToString() => Value.ToString(); public bool Equals(Oid other) => Value == other.Value; public override bool Equals(object? obj) => obj is Oid other && Equals(other); public override int GetHashCode() => (int)Value; public static bool operator ==(Oid left, Oid right) => left.Equals(right); public static bool operator !=(Oid left, Oid right) => !left.Equals(right); }