Exemplo n.º 1
0
 public static NativeFieldPath ToNative(this FieldPath @this)
 {
     return(@this.IsDocumentId ? NativeFieldPath.DocumentId() : NativeFieldPath.Of(@this.Fields));
 }
Exemplo n.º 2
0
        public static NativeSetOptions ToNative(this SetOptions options)
        {
            switch (options.Type)
            {
            case SetOptions.TypeMerge:
                return(NativeSetOptions.Merge());

            case SetOptions.TypeMergeFieldPaths:
                return(NativeSetOptions.MergeFieldPaths(options.FieldPaths.Select(x => NativeFieldPath.Of(x.ToArray())).ToList()));

            case SetOptions.TypeMergeFields:
                return(NativeSetOptions.MergeFields(options.Fields));

            default:
                throw new ArgumentException($"SetOptions type {options.Type} is not supported.");
            }
        }