addEntity method

  1. @override
Future<AssignmentEntity> addEntity(
  1. String documentID,
  2. AssignmentEntity value
)
override

Implementation

@override
Future<AssignmentEntity> addEntity(
    String documentID, AssignmentEntity value) {
  return assignmentCollection
      .doc(documentID)
      .set(value.toDocument())
      .then((_) => value)
      .then((v) async {
    var newValue = await getEntity(documentID);
    if (newValue == null) {
      return value;
    } else {
      return newValue;
    }
  });
}