using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
using ProtocolBuffers.Protos.Configuration.Api;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
[Key] public Guid Id { get; set; } = Guid.Parse("bff3893e-ef55-47ef-aae2-b3d5898cd0a9");
[Column(TypeName = "jsonb")] public List<BlogOption> OptionDefinitions { get; set; } = new List<BlogOption>();
public bool IsActive { get; set; }
public bool IsRequired { get; set; }
public int SortOrder { get; set; }
public int Width { get; set; }
public string Name { get; set; }
public string? Description { get; set; }
public string PageName { get; set; }
public string Value { get; set; }
public string? Tooltip { get; set; }
public string? TypeString { get; set; }
public string? ValidationType { get; set; }
public bool IsActive { get; set; }
public int NumberOfTimesUsed { get; set; }
public int SortOrder { get; set; }
public string Name { get; set; }
public class BloggingContext : DbContext
public BloggingContext() { }
public BloggingContext(DbContextOptions<BloggingContext> options)
public DbSet<Blog> Blogs { get; set; }
private BloggingContext _context;
public BlogService(BloggingContext context)
var customField = new Blog
var redOption = new BlogOption
var blueOption = new BlogOption
customField.OptionDefinitions.Add(redOption);
customField.OptionDefinitions.Add(blueOption);
_context.Blogs.Add(customField);
static void Main(string[] args)
var remoteConnectionString = $"Host=db-postgresql-sfo2-76371-do-user-10529433-0.b.db.ondigitalocean.com;Port=25060;Username=EFTest;Password=VStW3x816PCGtTVV;Database=EFTesting;SSL Mode=Require;Trust Server Certificate=true;";
var config = new MapperConfiguration(cfg => {
cfg.CreateMap<Blog, FindBlogResponse>();
cfg.CreateMap<BlogOption, ProtocolBuffers.Protos.Configuration.Api.OptionsDefinitionModel>();
IMapper mapper = config.CreateMapper();
var options = new DbContextOptionsBuilder<BloggingContext>()
.UseNpgsql(remoteConnectionString, options =>
options.UseAdminDatabase("defaultdb");
options.EnableRetryOnFailure();
using (var context = new BloggingContext(options))
var query = context.Set<Blog>().Where(a => a.Id == Guid.Parse("bff3893e-ef55-47ef-aae2-b3d5898cd0a9"));
var data = query.Single();
FindBlogResponse result = mapper.ProjectTo<FindBlogResponse>(query).Single();
Console.WriteLine($"ProjectTo - Options Count From DB: {data.OptionDefinitions.Count}, From AutoMapper: {result.OptionDefinitions.Count}");
FindBlogResponse mapResult = mapper.Map<FindBlogResponse>(data);
Console.WriteLine($"Map - Options Count From DB: {data.OptionDefinitions.Count}, From AutoMapper: {mapResult.OptionDefinitions.Count}");
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
namespace ProtocolBuffers.Protos.Configuration.Api
public static partial class CustomFieldV1Reflection
public static pbr::FileDescriptor Descriptor
get { return descriptor; }
private static pbr::FileDescriptor descriptor;
static CustomFieldV1Reflection()
byte[] descriptorData = global::System.Convert.FromBase64String(
"CidDb25maWd1cmF0aW9uLkFwaS9jdXN0b21fZmllbGQudjEucHJvdG8SSWFw",
"b2xsby5idWlsZGluZ19ibG9ja3MucHJvdG9jb2xfYnVmZmVycy5jb25maWd1",
"cmF0aW9uX2FwaS5jdXN0b21fZmllbGQudjEiGAoWRmluZEN1c3RvbUZpZWxk",
"UmVxdWVzdCKkAgoXRmluZEN1c3RvbUZpZWxkUmVzcG9uc2USCgoCaWQYASAB",
"KAkSDAoEbmFtZRgEIAEoCRIRCglzb3J0T3JkZXIYBiABKAUSDQoFdmFsdWUY",
"ByABKAkSfAoRb3B0aW9uRGVmaW5pdGlvbnMYCCADKAsyYS5hcG9sbG8uYnVp",
"bGRpbmdfYmxvY2tzLnByb3RvY29sX2J1ZmZlcnMuY29uZmlndXJhdGlvbl9h",
"cGkuY3VzdG9tX2ZpZWxkLnYxLk9wdGlvbnNEZWZpbml0aW9uTW9kZWwSDQoF",
"d2lkdGgYCiABKAUSEgoKaXNSZXF1aXJlZBgMIAEoCBIQCghpc0FjdGl2ZRgN",
"IAEoCBIaChJsYXN0TW9kaWZpZWRCeU5hbWUYDiABKAkiZgoWT3B0aW9uc0Rl",
"ZmluaXRpb25Nb2RlbBIMCgRuYW1lGAEgASgJEhAKCGlzQWN0aXZlGAIgASgI",
"EhEKCXNvcnRPcmRlchgDIAEoBRIZChFudW1iZXJPZlRpbWVzVXNlZBgEIAEo",
"BTLqAQoWQ3VzdG9tRmllbGRHcnBjU2VydmljZRLPAQoERmluZBJhLmFwb2xs",
"by5idWlsZGluZ19ibG9ja3MucHJvdG9jb2xfYnVmZmVycy5jb25maWd1cmF0",
"aW9uX2FwaS5jdXN0b21fZmllbGQudjEuRmluZEN1c3RvbUZpZWxkUmVxdWVz",
"dBpiLmFwb2xsby5idWlsZGluZ19ibG9ja3MucHJvdG9jb2xfYnVmZmVycy5j",
"b25maWd1cmF0aW9uX2FwaS5jdXN0b21fZmllbGQudjEuRmluZEN1c3RvbUZp",
"ZWxkUmVzcG9uc2UiAEIrqgIoUHJvdG9jb2xCdWZmZXJzLlByb3Rvcy5Db25m",
"aWd1cmF0aW9uLkFwaWIGcHJvdG8z"));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::ProtocolBuffers.Protos.Configuration.Api.FindCustomFieldRequest), global::ProtocolBuffers.Protos.Configuration.Api.FindCustomFieldRequest.Parser, null, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::ProtocolBuffers.Protos.Configuration.Api.FindBlogResponse), global::ProtocolBuffers.Protos.Configuration.Api.FindBlogResponse.Parser, new[]{ "Id", "Name", "SortOrder", "Value", "OptionDefinitions", "Width", "IsRequired", "IsActive", "LastModifiedByName" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::ProtocolBuffers.Protos.Configuration.Api.OptionsDefinitionModel), global::ProtocolBuffers.Protos.Configuration.Api.OptionsDefinitionModel.Parser, new[]{ "Name", "IsActive", "SortOrder", "NumberOfTimesUsed" }, null, null, null, null)
public sealed partial class FindCustomFieldRequest : pb::IMessage<FindCustomFieldRequest>
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
private static readonly pb::MessageParser<FindCustomFieldRequest> _parser = new pb::MessageParser<FindCustomFieldRequest>(() => new FindCustomFieldRequest());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pb::MessageParser<FindCustomFieldRequest> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pbr::MessageDescriptor Descriptor
get { return global::ProtocolBuffers.Protos.Configuration.Api.CustomFieldV1Reflection.Descriptor.MessageTypes[0]; }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
pbr::MessageDescriptor pb::IMessage.Descriptor
get { return Descriptor; }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public FindCustomFieldRequest()
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public FindCustomFieldRequest(FindCustomFieldRequest other) : this()
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public FindCustomFieldRequest Clone()
return new FindCustomFieldRequest(this);
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other)
return Equals(other as FindCustomFieldRequest);
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public bool Equals(FindCustomFieldRequest other)
if (ReferenceEquals(other, null))
if (ReferenceEquals(other, this))
return Equals(_unknownFields, other._unknownFields);
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override int GetHashCode()
if (_unknownFields != null)
hash ^= _unknownFields.GetHashCode();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override string ToString()
return pb::JsonFormatter.ToDiagnosticString(this);
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void WriteTo(pb::CodedOutputStream output)
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
output.WriteRawMessage(this);
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output)
if (_unknownFields != null)
_unknownFields.WriteTo(ref output);
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CalculateSize()
if (_unknownFields != null)
size += _unknownFields.CalculateSize();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(FindCustomFieldRequest other)
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(pb::CodedInputStream input)
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
input.ReadRawMessage(this);
while ((tag = input.ReadTag()) != 0) {
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input)
while ((tag = input.ReadTag()) != 0)
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
public sealed partial class FindBlogResponse : pb::IMessage<FindBlogResponse>
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
private static readonly pb::MessageParser<FindBlogResponse> _parser = new pb::MessageParser<FindBlogResponse>(() => new FindBlogResponse());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pb::MessageParser<FindBlogResponse> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pbr::MessageDescriptor Descriptor
get { return global::ProtocolBuffers.Protos.Configuration.Api.CustomFieldV1Reflection.Descriptor.MessageTypes[1]; }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
pbr::MessageDescriptor pb::IMessage.Descriptor
get { return Descriptor; }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public FindBlogResponse()
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public FindBlogResponse(FindBlogResponse other) : this()
sortOrder_ = other.sortOrder_;
optionDefinitions_ = other.optionDefinitions_.Clone();
isRequired_ = other.isRequired_;
isActive_ = other.isActive_;
lastModifiedByName_ = other.lastModifiedByName_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public FindBlogResponse Clone()
return new FindBlogResponse(this);
public const int IdFieldNumber = 1;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
id_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
public const int NameFieldNumber = 4;
private string name_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
public const int SortOrderFieldNumber = 6;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
get { return sortOrder_; }
public const int ValueFieldNumber = 7;
private string value_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
value_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
public const int OptionDefinitionsFieldNumber = 8;
private static readonly pb::FieldCodec<global::ProtocolBuffers.Protos.Configuration.Api.OptionsDefinitionModel> _repeated_optionDefinitions_codec
= pb::FieldCodec.ForMessage(66, global::ProtocolBuffers.Protos.Configuration.Api.OptionsDefinitionModel.Parser);
private readonly pbc::RepeatedField<global::ProtocolBuffers.Protos.Configuration.Api.OptionsDefinitionModel> optionDefinitions_ = new pbc::RepeatedField<global::ProtocolBuffers.Protos.Configuration.Api.OptionsDefinitionModel>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public pbc::RepeatedField<global::ProtocolBuffers.Protos.Configuration.Api.OptionsDefinitionModel> OptionDefinitions
get { return optionDefinitions_; }
public const int WidthFieldNumber = 10;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public const int IsRequiredFieldNumber = 12;
private bool isRequired_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
get { return isRequired_; }
public const int IsActiveFieldNumber = 13;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
get { return isActive_; }
public const int LastModifiedByNameFieldNumber = 14;
private string lastModifiedByName_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public string LastModifiedByName
get { return lastModifiedByName_; }
lastModifiedByName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other)
return Equals(other as FindBlogResponse);
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public bool Equals(FindBlogResponse other)
if (ReferenceEquals(other, null))
if (ReferenceEquals(other, this))
if (Id != other.Id) return false;
if (Name != other.Name) return false;
if (SortOrder != other.SortOrder) return false;
if (Value != other.Value) return false;
if (!optionDefinitions_.Equals(other.optionDefinitions_)) return false;
if (Width != other.Width) return false;
if (IsRequired != other.IsRequired) return false;
if (IsActive != other.IsActive) return false;
if (LastModifiedByName != other.LastModifiedByName) return false;
return Equals(_unknownFields, other._unknownFields);
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override int GetHashCode()
if (Id.Length != 0) hash ^= Id.GetHashCode();
if (Name.Length != 0) hash ^= Name.GetHashCode();
if (SortOrder != 0) hash ^= SortOrder.GetHashCode();
if (Value.Length != 0) hash ^= Value.GetHashCode();
hash ^= optionDefinitions_.GetHashCode();
if (Width != 0) hash ^= Width.GetHashCode();
if (IsRequired != false) hash ^= IsRequired.GetHashCode();
if (IsActive != false) hash ^= IsActive.GetHashCode();
if (LastModifiedByName.Length != 0) hash ^= LastModifiedByName.GetHashCode();
if (_unknownFields != null)
hash ^= _unknownFields.GetHashCode();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override string ToString()
return pb::JsonFormatter.ToDiagnosticString(this);
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void WriteTo(pb::CodedOutputStream output)
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
output.WriteRawMessage(this);
output.WriteString(Name);
output.WriteInt32(SortOrder);
output.WriteString(Value);
optionDefinitions_.WriteTo(output, _repeated_optionDefinitions_codec);
output.WriteInt32(Width);
if (IsRequired != false) {
output.WriteBool(IsRequired);
output.WriteBool(IsActive);
if (LastModifiedByName.Length != 0) {
output.WriteString(LastModifiedByName);
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output)
output.WriteString(Name);
output.WriteInt32(SortOrder);
output.WriteString(Value);
optionDefinitions_.WriteTo(ref output, _repeated_optionDefinitions_codec);
output.WriteInt32(Width);
output.WriteBool(IsRequired);
output.WriteBool(IsActive);
if (LastModifiedByName.Length != 0)
output.WriteString(LastModifiedByName);
if (_unknownFields != null)
_unknownFields.WriteTo(ref output);
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CalculateSize()
size += 1 + pb::CodedOutputStream.ComputeStringSize(Id);
size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
size += 1 + pb::CodedOutputStream.ComputeInt32Size(SortOrder);
size += 1 + pb::CodedOutputStream.ComputeStringSize(Value);
size += optionDefinitions_.CalculateSize(_repeated_optionDefinitions_codec);
size += 1 + pb::CodedOutputStream.ComputeInt32Size(Width);
if (LastModifiedByName.Length != 0)
size += 1 + pb::CodedOutputStream.ComputeStringSize(LastModifiedByName);
if (_unknownFields != null)
size += _unknownFields.CalculateSize();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(FindBlogResponse other)
if (other.Id.Length != 0)
if (other.Name.Length != 0)
if (other.SortOrder != 0)
SortOrder = other.SortOrder;
if (other.Value.Length != 0)
optionDefinitions_.Add(other.optionDefinitions_);
if (other.IsRequired != false)
IsRequired = other.IsRequired;
if (other.IsActive != false)
IsActive = other.IsActive;
if (other.LastModifiedByName.Length != 0)
LastModifiedByName = other.LastModifiedByName;
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(pb::CodedInputStream input)
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
input.ReadRawMessage(this);
while ((tag = input.ReadTag()) != 0) {
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
Name = input.ReadString();
SortOrder = input.ReadInt32();
Value = input.ReadString();
optionDefinitions_.AddEntriesFrom(input, _repeated_optionDefinitions_codec);
Width = input.ReadInt32();
IsRequired = input.ReadBool();
IsActive = input.ReadBool();
LastModifiedByName = input.ReadString();
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input)
while ((tag = input.ReadTag()) != 0)
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
Name = input.ReadString();
SortOrder = input.ReadInt32();
Value = input.ReadString();
optionDefinitions_.AddEntriesFrom(ref input, _repeated_optionDefinitions_codec);
Width = input.ReadInt32();
IsRequired = input.ReadBool();
IsActive = input.ReadBool();
LastModifiedByName = input.ReadString();
public sealed partial class OptionsDefinitionModel : pb::IMessage<OptionsDefinitionModel>
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
private static readonly pb::MessageParser<OptionsDefinitionModel> _parser = new pb::MessageParser<OptionsDefinitionModel>(() => new OptionsDefinitionModel());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pb::MessageParser<OptionsDefinitionModel> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pbr::MessageDescriptor Descriptor
get { return global::ProtocolBuffers.Protos.Configuration.Api.CustomFieldV1Reflection.Descriptor.MessageTypes[2]; }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
pbr::MessageDescriptor pb::IMessage.Descriptor
get { return Descriptor; }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public OptionsDefinitionModel()
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public OptionsDefinitionModel(OptionsDefinitionModel other) : this()
isActive_ = other.isActive_;
sortOrder_ = other.sortOrder_;
numberOfTimesUsed_ = other.numberOfTimesUsed_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public OptionsDefinitionModel Clone()
return new OptionsDefinitionModel(this);
public const int NameFieldNumber = 1;
private string name_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
public const int IsActiveFieldNumber = 2;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
get { return isActive_; }
public const int SortOrderFieldNumber = 3;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
get { return sortOrder_; }
public const int NumberOfTimesUsedFieldNumber = 4;
private int numberOfTimesUsed_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int NumberOfTimesUsed
get { return numberOfTimesUsed_; }
numberOfTimesUsed_ = value;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other)
return Equals(other as OptionsDefinitionModel);
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public bool Equals(OptionsDefinitionModel other)
if (ReferenceEquals(other, null))
if (ReferenceEquals(other, this))
if (Name != other.Name) return false;
if (IsActive != other.IsActive) return false;
if (SortOrder != other.SortOrder) return false;
if (NumberOfTimesUsed != other.NumberOfTimesUsed) return false;
return Equals(_unknownFields, other._unknownFields);
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override int GetHashCode()
if (Name.Length != 0) hash ^= Name.GetHashCode();
if (IsActive != false) hash ^= IsActive.GetHashCode();
if (SortOrder != 0) hash ^= SortOrder.GetHashCode();
if (NumberOfTimesUsed != 0) hash ^= NumberOfTimesUsed.GetHashCode();
if (_unknownFields != null)
hash ^= _unknownFields.GetHashCode();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override string ToString()
return pb::JsonFormatter.ToDiagnosticString(this);
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void WriteTo(pb::CodedOutputStream output)
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
output.WriteRawMessage(this);
output.WriteString(Name);
output.WriteBool(IsActive);
output.WriteInt32(SortOrder);
if (NumberOfTimesUsed != 0) {
output.WriteInt32(NumberOfTimesUsed);
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output)
output.WriteString(Name);
output.WriteBool(IsActive);
output.WriteInt32(SortOrder);
if (NumberOfTimesUsed != 0)
output.WriteInt32(NumberOfTimesUsed);
if (_unknownFields != null)
_unknownFields.WriteTo(ref output);
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CalculateSize()
size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
size += 1 + pb::CodedOutputStream.ComputeInt32Size(SortOrder);
if (NumberOfTimesUsed != 0)
size += 1 + pb::CodedOutputStream.ComputeInt32Size(NumberOfTimesUsed);
if (_unknownFields != null)
size += _unknownFields.CalculateSize();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(OptionsDefinitionModel other)
if (other.Name.Length != 0)
if (other.IsActive != false)
IsActive = other.IsActive;
if (other.SortOrder != 0)
SortOrder = other.SortOrder;
if (other.NumberOfTimesUsed != 0)
NumberOfTimesUsed = other.NumberOfTimesUsed;
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(pb::CodedInputStream input)
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
input.ReadRawMessage(this);
while ((tag = input.ReadTag()) != 0) {
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
Name = input.ReadString();
IsActive = input.ReadBool();
SortOrder = input.ReadInt32();
NumberOfTimesUsed = input.ReadInt32();
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input)
while ((tag = input.ReadTag()) != 0)
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
Name = input.ReadString();
IsActive = input.ReadBool();
SortOrder = input.ReadInt32();
NumberOfTimesUsed = input.ReadInt32();
#endregion Designer generated code