小编Jas*_*all的帖子

C#如何将数组插入对象mongodb

目前,我正在使用C#开发一个应用程序,在该应用程序中我想向MongoDB集合中添加一些数据。我正在尝试将数组添加到Employee对象,但是我正在努力使其正常工作。

当我查看其他帖子时,我遇到了使用BsonDocument的语法,如下所示:

var document = new BsonDocument {
{ "author", "joe" },
{ "comments", new BsonArray {
    new BsonDocument { { "author", "jim" }, { "comment", "I disagree" } },
    new BsonDocument { { "author", "nancy" }, { "comment", "Good post" } }
}}
Run Code Online (Sandbox Code Playgroud)

我想向Function属性添加数组以添加描述和其他详细信息。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MongoDB.Driver;
using MongoDB.Bson;
using MongoDB.Driver.Core;

namespace Application
{
    class Program
    {
        public class Employee
        {
            public ObjectId Id { get; set; }
            public string …
Run Code Online (Sandbox Code Playgroud)

c# arrays mongodb

5
推荐指数
1
解决办法
2050
查看次数

如何从CSS中的图像获得这种部分对角线形状

我正在使用bootstrap 4并尝试创建这种形状的图像:

整个正方形是我的形象,但我想切掉红色部分或使其透明,以便看到背景颜色.

<div class="container">
   <div class="row">
       <div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
           <img src="path/to/image" class="img-fluid" alt="Some text">
       </div>
   </div>
</div>
Run Code Online (Sandbox Code Playgroud)

我怎么做到这一点?

html css css3 twitter-bootstrap css-shapes

0
推荐指数
1
解决办法
496
查看次数

标签 统计

arrays ×1

c# ×1

css ×1

css-shapes ×1

css3 ×1

html ×1

mongodb ×1

twitter-bootstrap ×1